forked from readthedocs/readthedocs.org
-
Notifications
You must be signed in to change notification settings - Fork 1
/
readthedocs.wsgi
33 lines (23 loc) · 893 Bytes
/
readthedocs.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
import os, sys
#sys.stdout = sys.stderr
ALLDIRS = ['/projects/readthedocs/lib/python2.6/site-packages']
import site
# Remember original sys.path.
prev_sys_path = list(sys.path)
# Add each new site-packages directory.
for directory in ALLDIRS:
site.addsitedir(directory)
# Reorder sys.path so new directories at the front.
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
sys.path.append('/projects/readthedocs/checkouts/readthedocs.org/readthedocs')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings.postgres'
os.environ['CELERY_LOADER'] = 'django'
activate_this = "/projects/readthedocs/bin/activate_this.py"
execfile(activate_this, dict(__file__=activate_this))
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()