feat: base 生产环境关闭swagger

This commit is contained in:
caoqianming 2024-04-28 13:59:06 +08:00
parent ece11699f8
commit 323be38d38
1 changed files with 9 additions and 7 deletions

View File

@ -67,15 +67,17 @@ urlpatterns = [
path('', include('apps.pm.urls')), path('', include('apps.pm.urls')),
path('', include('apps.enp.urls')), path('', include('apps.enp.urls')),
# api文档
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'),
# 前端页面入口 # 前端页面入口
path('', TemplateView.as_view(template_name="index.html")), path('', TemplateView.as_view(template_name="index.html")),
] + \ ] + \
static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + \ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + \
static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
if settings.DEBUG:
urlpatterns += [
# api文档
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'),
]