Skip to content

Commit 7bb7fa6

Browse files
committed
Add interactive API docs
1 parent 25b8697 commit 7bb7fa6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tutorial/urls.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
from django.conf.urls import include, url
22
from rest_framework.schemas import get_schema_view
3+
from rest_framework.documentation import include_docs_urls
34

4-
schema_view = get_schema_view(title='Pastebin API')
5+
API_TITLE = 'Pastebin API'
6+
API_DESCRIPTION = 'A Web API for creating and viewing highlighted code snippets.'
7+
schema_view = get_schema_view(title=API_TITLE)
58

69
urlpatterns = [
710
url(r'^', include('snippets.urls')),
8-
url(r'^api-auth/',
9-
include('rest_framework.urls', namespace='rest_framework')),
11+
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
1012
url(r'^schema/$', schema_view),
13+
url(r'^docs/', include_docs_urls(title=API_TITLE, description=API_DESCRIPTION))
1114
]

0 commit comments

Comments
 (0)