aboutsummaryrefslogtreecommitdiff
path: root/wsgi_production.py
blob: b538e9bd1d37fc59f258329c9eca3cc19c826b15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)