From 1650fe7821ef0b85612bfc496af428c80188f1e9 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 20 Aug 2009 20:58:56 +0200 Subject: [PATCH] try to fix python path --- wsgi/django.wsgi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wsgi/django.wsgi b/wsgi/django.wsgi index 1179b38..1b7a8ad 100644 --- a/wsgi/django.wsgi +++ b/wsgi/django.wsgi @@ -5,15 +5,15 @@ import site project_module = 'oxdata' -# One directory above the project, so project name will be needed for imports root_dir = os.path.normpath(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))) +site_package = os.path.normpath(os.path.join(root_dir, project_module, '..', 'env', 'lib', 'python2.5', 'site-packages')) -# with mod_wsgi >= 2.4, this line will add this path in front of the python path -site.addsitedir(os.path.join(root_dir, project_module, '..', 'env', 'lib', 'python2.5', 'site-packages')) +site.addsitedir(site_package) # add this django project -sys.path.append(root_dir) -sys.path.append(os.path.join(root_dir, project_module)) +sys.path.insert(0, root_dir) +sys.path.insert(0, os.path.join(root_dir, project_module)) +sys.path.insert(0, site_package) #reload if this django.wsgi gets touched import monitor