forked from bread-and-pepper/django-userena
-
Notifications
You must be signed in to change notification settings - Fork 0
/
django-userena.wsgi
35 lines (26 loc) · 971 Bytes
/
django-userena.wsgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Settings for django-userena.
# http://django-userena.org
import os
import sys
import site
HOMEDIR = os.path.dirname(os.path.realpath(__file__))
ALLDIRS = [ HOMEDIR + '/lib/python2.6/site-packages']
prev_sys_path = list(sys.path)
for directory in ALLDIRS:
site.addsitedir(directory)
new_sys_path = []
for item in list(sys.path):
if item not in prev_sys_path:
new_sys_path.append(item)
sys.path.remove(item)
sys.path[:0] = new_sys_path
# this will also be different for each project!
sys.path.append(HOMEDIR + '/demo_project')
sys.path.append(HOMEDIR)
os.environ['PYTHON_EGG_CACHE'] = HOMEDIR + '.python-eggs'
os.environ['DJANGO_SETTINGS_MODULE'] = 'demo_project.settings_production'
import django.core.handlers.wsgi
_application = django.core.handlers.wsgi.WSGIHandler()
def application(environ, start_response):
environ['wsgi.url_scheme'] = environ.get('HTTP_X_URL_SCHEME', 'http')
return _application(environ, start_response)