Created
September 10, 2019 12:02
-
-
Save olegkovalov/1efedebf06bfd95945439e7c7fe53769 to your computer and use it in GitHub Desktop.
Add doc urls
This file contains hidden or 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 drf_yasg.views import get_schema_view | |
from drf_yasg import openapi | |
from rest_framework import permissions | |
schema_view = get_schema_view( | |
openapi.Info( | |
title="Blog API", | |
default_version='v1', | |
description="Test description", | |
), | |
public=True, | |
permission_classes=(permissions.AllowAny,), | |
) | |
urlpatterns = [ | |
path('admin/', admin.site.urls), | |
path('doc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), | |
re_path(r'api/(?P<version>[v1|v2]+)/', include('django_blog.apps.blog.rest_api.urls')), | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment