增加swagger.json
This commit is contained in:
parent
d85f52454c
commit
03f88f89c1
|
@ -18,6 +18,7 @@ from django.conf import settings
|
|||
from django.conf.urls.static import static
|
||||
from django.contrib import admin
|
||||
from django.urls import include, path
|
||||
from django.conf.urls import url
|
||||
from drf_yasg import openapi
|
||||
from drf_yasg.views import get_schema_view
|
||||
from rest_framework import routers
|
||||
|
@ -47,6 +48,7 @@ urlpatterns = [
|
|||
|
||||
# api文档
|
||||
path('api/docs/', include_docs_urls(title="接口文档", authentication_classes=[], permission_classes=[])),
|
||||
url(r'^api/swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
|
||||
path('api/swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
|
||||
path('api/redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
|
||||
|
||||
|
|
Loading…
Reference in New Issue