src/notes/api/urls.py
author ymh <ymh.work@gmail.com>
Tue, 27 Jun 2017 11:38:26 +0200
changeset 97 69eaef18b01b
parent 31 63be3ce389f7
child 119 8ff8e2aee0f9
permissions -rw-r--r--
Improve the network saga. Try to avoid unnecessary token refresh

from django.conf.urls import url, include
from rest_framework_nested import routers
from .views import SessionViewSet, NoteViewSet

router = routers.SimpleRouter()
router.register(r'sessions', SessionViewSet, base_name='session')

session_router = routers.NestedSimpleRouter(router, r'sessions', lookup='session')
session_router.register(r'notes', NoteViewSet, base_name='notes')

# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
    url(r'^', include(router.urls)),
    url(r'^', include(session_router.urls)),
]