author | amit@thunder |
Thu, 04 Mar 2010 14:33:38 +0530 | |
changeset 43 | 134b87b382f5 |
parent 22 | a27f1e69d966 |
permissions | -rwxr-xr-x |
6 | 1 |
import os |
2 |
home_dir=os.getenv("HOME") |
|
3 |
if home_dir=='/home/amit': |
|
4 |
ALLDIRS = ['/home/amit/SEES-hacks/SEESenv/lib/python2.6/site-packages'] |
|
5 |
else: |
|
6 |
ALLDIRS = ['/home/hg/repos/SEES-hacks/SEESenv/lib/python2.6/site-packages'] |
|
3 | 7 |
import sys |
8 |
import site |
|
9 |
||
10 |
# Remember original sys.path. |
|
11 |
prev_sys_path = list(sys.path) |
|
12 |
||
13 |
# Add each new site-packages directory. |
|
14 |
for directory in ALLDIRS: |
|
15 |
site.addsitedir(directory) |
|
16 |
||
17 |
# Reorder sys.path so new directories at the front. |
|
18 |
new_sys_path = [] |
|
19 |
for item in list(sys.path): |
|
20 |
if item not in prev_sys_path: |
|
21 |
new_sys_path.append(item) |
|
22 |
sys.path.remove(item) |
|
23 |
sys.path[:0] = new_sys_path |
|
24 |
||
0
8083d21c0020
The first commit of all the required files for the review app
amit@thunder
parents:
diff
changeset
|
25 |
import os |
8083d21c0020
The first commit of all the required files for the review app
amit@thunder
parents:
diff
changeset
|
26 |
import sys |
8083d21c0020
The first commit of all the required files for the review app
amit@thunder
parents:
diff
changeset
|
27 |
import django |
10 | 28 |
|
29 |
||
9 | 30 |
print >>sys.stderr , "My Review App running" |
10 | 31 |
|
6 | 32 |
home_dir=os.getenv("HOME") |
22
a27f1e69d966
testing .. I am really confused about how to handle the change of repos from /home/amit to /home/hg
amit@thunder
parents:
21
diff
changeset
|
33 |
print >> sys.stderr , home_dir |
a27f1e69d966
testing .. I am really confused about how to handle the change of repos from /home/amit to /home/hg
amit@thunder
parents:
21
diff
changeset
|
34 |
if home_dir=='/home/amit': |
20 | 35 |
sys.path.append('/home/amit/SEES-hacks/SEESenv/web') |
6 | 36 |
sys.path.append('/home/amit/SEES-hacks/SEESenv/web/hgbook/comments') |
37 |
else: |
|
20 | 38 |
sys.path.append('/home/hg/repos/SEES-hacks/SEESenv/web') |
6 | 39 |
sys.path.append('/home/hg/repos/SEES-hacks/SEESenv/web/hgbook/comments') |
21 | 40 |
print >> sys.stderr , sys.path |
0
8083d21c0020
The first commit of all the required files for the review app
amit@thunder
parents:
diff
changeset
|
41 |
os.environ['DJANGO_SETTINGS_MODULE'] = 'hgbook.settings' |
21 | 42 |
|
0
8083d21c0020
The first commit of all the required files for the review app
amit@thunder
parents:
diff
changeset
|
43 |
import django.core.handlers.wsgi |
21 | 44 |
|
11 | 45 |
print >> sys.stderr , django.core.handlers.wsgi.WSGIRequest.GET |
0
8083d21c0020
The first commit of all the required files for the review app
amit@thunder
parents:
diff
changeset
|
46 |
application = django.core.handlers.wsgi.WSGIHandler() |
10 | 47 |
print >> sys.stderr , django.core.handlers.wsgi.WSGIRequest.GET |
48 |
_application = django.core.handlers.wsgi.WSGIHandler() |
|
49 |
#print >> sys.stderr , django.core.handlers.wsgi.WSGIRequest.GET |
|
50 |
def application(environ, start_response): |
|
51 |
print >> sys.stderr ,environ['PATH_INFO'] |
|
52 |
||
53 |
return _application(environ, start_response) |
|
0
8083d21c0020
The first commit of all the required files for the review app
amit@thunder
parents:
diff
changeset
|
54 |
|
8083d21c0020
The first commit of all the required files for the review app
amit@thunder
parents:
diff
changeset
|
55 |
|
8083d21c0020
The first commit of all the required files for the review app
amit@thunder
parents:
diff
changeset
|
56 |