Created
March 8, 2019 22:07
-
-
Save craigderington/c39d96dd1f026f5fd5dcddf006b97a38 to your computer and use it in GitHub Desktop.
DRF by Example Root URLs Module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.urls import path | |
from django.conf.urls import include | |
from django.conf import settings | |
from django.contrib import admin | |
from rest_framework_swagger.views import get_swagger_view | |
from .views import api_root | |
schema_view = get_swagger_view(title='DRF by Example') | |
# url list | |
urlpatterns = [ | |
path('', api_root), | |
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')), | |
path('admin/', admin.site.urls), | |
path('api/docs/', schema_view), | |
path('bookmarks/', include('bookmarks.urls')), | |
path('snippets/', include('snippets.urls')), | |
path('users/', include('users.urls')), | |
path('locations/', include('locations.urls')), | |
path('todos/', include('todos.urls')), | |
path('notes/', include('notes.urls')), | |
] | |
if settings.DEBUG: | |
import debug_toolbar | |
urlpatterns += [ | |
path('__debug__', include(debug_toolbar.urls)) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment