summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--reports/reports.wsgi7
1 files changed, 6 insertions, 1 deletions
diff --git a/reports/reports.wsgi b/reports/reports.wsgi
index 235715854..92401d763 100644
--- a/reports/reports.wsgi
+++ b/reports/reports.wsgi
@@ -1,4 +1,9 @@
import os
+import Bcfg2.settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'Bcfg2.settings'
import django.core.handlers.wsgi
-application = django.core.handlers.wsgi.WSGIHandler()
+
+def application(environ, start_response):
+ if 'BCFG2_CONFIG_FILE' in environ:
+ Bcfg2.settings.read_config(cfile=environ['BCFG2_CONFIG_FILE'])
+ return django.core.handlers.wsgi.WSGIHandler()(environ, start_response)