Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.