diff options
author | Andy Doan <andy.doan@linaro.org> | 2015-01-07 17:19:14 -0600 |
---|---|---|
committer | Andy Doan <andy.doan@linaro.org> | 2015-01-07 21:39:25 -0600 |
commit | 66f5fd1163a9d8b59bdefe3a292acb36d245fa88 (patch) | |
tree | b2358fc5f83e916acd76e8a8ec91fa4ebe75d693 /wsgi_production.py | |
parent | 3212eb02dab56c1b21c8342dcb11caa5c0789573 (diff) |
add production version of wsgi and settings
These were broken and maintained separately, but they can
all be easily consolidated.
With this change in place we can delete:
https://git.linaro.org/infrastructure/linaro-license-protection-configs.git
Change-Id: Iae15f15c822de3d181d8baec9b2e7c0e4b6fe405
Diffstat (limited to 'wsgi_production.py')
-rw-r--r-- | wsgi_production.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/wsgi_production.py b/wsgi_production.py new file mode 100644 index 0000000..b538e9b --- /dev/null +++ b/wsgi_production.py @@ -0,0 +1,19 @@ +import os +import sys + +from django.core.handlers.wsgi import WSGIHandler + +here = os.path.abspath(os.path.dirname(__file__)) +sys.path.append(here) + +os.environ["DJANGO_SETTINGS_MODULE"] = 'settings_production' +APP_ENVS = ['SITE_NAME', 'HOST_NAME'] + +_app = WSGIHandler() + + +def application(environ, start_response): + # pass the WSGI environment variables on through to os.environ + for var in APP_ENVS: + os.environ[var] = environ.get(var, '') + return _app(environ, start_response) |