Skip to content

Commit 6e4256d

Browse files
committed
add API schema
1 parent da50244 commit 6e4256d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

days/069-072-django-rest/demo/mysite/urls.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
from django.contrib import admin
22
from django.urls import include, path
3+
from rest_framework.schemas import get_schema_view
34

5+
TITLE = 'Quotes API'
6+
7+
schema_view = get_schema_view(title=TITLE)
48

59
urlpatterns = [
610
path('', include('quotes.urls')),
@@ -9,4 +13,5 @@
913
path('accounts/', include('django.contrib.auth.urls')),
1014
path('api/', include('api.urls')),
1115
path('api-auth/', include('rest_framework.urls')),
16+
path('schema/', schema_view),
1217
]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
django
22
django-registration
33
djangorestframework
4+
coreapi
5+
pyyaml

0 commit comments

Comments
 (0)