Skip to content

Instantly share code, notes, and snippets.

@olegkovalov
Created September 10, 2019 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save olegkovalov/1efedebf06bfd95945439e7c7fe53769 to your computer and use it in GitHub Desktop.
Save olegkovalov/1efedebf06bfd95945439e7c7fe53769 to your computer and use it in GitHub Desktop.
Add doc urls
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