author | amit@thunder |
Mon, 22 Feb 2010 18:19:02 +0530 | |
changeset 21 | 5f66214fce86 |
parent 19 | a9636afd4c95 |
child 22 | a27f1e69d966 |
permissions | -rw-r--r-- |
9 | 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 |
||
30 |
print >>sys.stderr , "My Review App running" |
|
31 |
||
6 | 32 |
home_dir=os.getenv("HOME") |
16 | 33 |
if home_dir=='/home/amit' or home_dir==None: |
21 | 34 |
sys.path.append('/home/amit/SEES-hacks/SEESenv/web') |
6 | 35 |
sys.path.append('/home/amit/SEES-hacks/SEESenv/web/hgbook/comments') |
36 |
else: |
|
21 | 37 |
sys.path.append('/home/hg/repos/SEES-hacks/SEESenv/web') |
6 | 38 |
sys.path.append('/home/hg/repos/SEES-hacks/SEESenv/web/hgbook/comments') |
21 | 39 |
print sys.path |
0
8083d21c0020
The first commit of all the required files for the review app
amit@thunder
parents:
diff
changeset
|
40 |
os.environ['DJANGO_SETTINGS_MODULE'] = 'hgbook.settings' |
21 | 41 |
|
1
672eaaab9204
Added some new html files that failed earlier during change from rst
amit@thunder
parents:
0
diff
changeset
|
42 |
import django.core.handlers.wsgi |
21 | 43 |
|
16 | 44 |
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
|
45 |
application = django.core.handlers.wsgi.WSGIHandler() |
10 | 46 |
print >> sys.stderr , django.core.handlers.wsgi.WSGIRequest.GET |
11 | 47 |
_application = django.core.handlers.wsgi.WSGIHandler() |
48 |
#print >> sys.stderr , django.core.handlers.wsgi.WSGIRequest.GET |
|
49 |
def application(environ, start_response): |
|
50 |
print >> sys.stderr ,environ['PATH_INFO'] |
|
51 |
||
52 |
return _application(environ, start_response) |
|
0
8083d21c0020
The first commit of all the required files for the review app
amit@thunder
parents:
diff
changeset
|
53 |
|
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 |