SEESenv/web/hgbook/run.wsgi
changeset 3 6cee07c589cb
parent 2 52d12eb31c30
child 6 1ce9b33fb6ff
--- a/SEESenv/web/hgbook/run.wsgi	Fri Feb 12 01:11:21 2010 +0530
+++ b/SEESenv/web/hgbook/run.wsgi	Sat Feb 13 12:29:22 2010 +0530
@@ -1,8 +1,28 @@
+ALLDIRS = ['/home/hg/repos/SEES-hacks/SEESenv/lib/python2.6/site-packages']
+
+import sys 
+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 
+
 import os
 import sys
 import django
-sys.path.append('/'.join(os.getcwd().split('/')[:-1])')
-sys.path.append(os.path.join(os.getcwd(),'comments'))
+sys.path.append('/home/hg/repos/SEES-hacks/SEESenv/web/')
+sys.path.append('/home/hg/repos/SEES-hacks/SEESenv/web/hgbook/comments')
 os.environ['DJANGO_SETTINGS_MODULE'] = 'hgbook.settings'
 import django.core.handlers.wsgi
 application = django.core.handlers.wsgi.WSGIHandler()