perf(url): 优化 /api/docs/? 都可以访问文档 (#4446)

Co-authored-by: ibuler <ibuler@qq.com>
pull/4454/head
fit2bot 2020-08-05 14:09:23 +08:00 committed by GitHub
parent f6a4253936
commit 15fe7f810b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -75,8 +75,8 @@ if settings.DEBUG:
urlpatterns += [
re_path('^api/swagger(?P<format>\.json|\.yaml)$',
views.get_swagger_view().without_ui(cache_timeout=1), name='schema-json'),
path('api/docs/', views.get_swagger_view().with_ui('swagger', cache_timeout=1), name="docs"),
path('api/redoc/', views.get_swagger_view().with_ui('redoc', cache_timeout=1), name='redoc'),
re_path('api/docs/?', views.get_swagger_view().with_ui('swagger', cache_timeout=1), name="docs"),
re_path('api/redoc/?', views.get_swagger_view().with_ui('redoc', cache_timeout=1), name='redoc'),
re_path('^api/v2/swagger(?P<format>\.json|\.yaml)$',
views.get_swagger_view().without_ui(cache_timeout=1), name='schema-json'),