4
import django.core.handlers.wsgi
5
from django.conf import settings
7
os.environ['DJANGO_SETTINGS_MODULE'] = 'dashboard.settings'
8
sys.stdout = sys.stderr
12
class WSGIRequest(django.core.handlers.wsgi.WSGIRequest):
14
value = self.META.get('wsgi.url_scheme', '').lower()
19
class WSGIHandler(django.core.handlers.wsgi.WSGIHandler):
20
request_class = WSGIRequest
22
_application = WSGIHandler()
24
def application(environ, start_response):
25
environ['PATH_INFO'] = environ['SCRIPT_NAME'] + environ['PATH_INFO']
26
environ['wsgi.url_scheme'] = environ.get('HTTP_X_URL_SCHEME', 'http')
28
return _application(environ, start_response)