diff --git a/server/urls.py b/server/urls.py index 7be6cba0..8c49f360 100755 --- a/server/urls.py +++ b/server/urls.py @@ -73,7 +73,7 @@ urlpatterns = [ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + \ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) -if settings.DEBUG: +if getattr(settings, 'ENABLE_SWAGGER', True): urlpatterns += [ # api文档 path('api/swagger/', schema_view.with_ui('swagger',