Commits

Waldemar Kornewald  committed 6b7070e

added support for staticfiles WSGI middleware

  • Participants
  • Parent commits 4f5d7a2

Comments (0)

Files changed (1)

File main/main.py

     os.environ.update(env_ext)
     setup_logging()
 
-    # Create a Django application for WSGI.
+    # Create a Django application for WSGI
     application = WSGIHandler()
 
+    # Add the staticfiles handler if necessary
+    if settings.DEBUG and 'django.contrib.staticfiles' in settings.INSTALLED_APPS:
+        from django.contrib.staticfiles.handlers import StaticFilesHandler
+        application = StaticFilesHandler(application)
+
     # Run the WSGI CGI handler with that application.
     run_wsgi_app(application)