Patchwork Change patchwork.wsgi to include the apps/ dir in sys.path

login
register
mail settings
Submitter Guilherme Salgado
Date Feb. 15, 2011, 12:30 p.m.
Message ID <1297773054-28065-1-git-send-email-guilherme.salgado@linaro.org>
Download mbox | patch
Permalink /patch/83240/
State Accepted
Commit 021a5b580c15994548d0288010c30be6b4d3a576
Headers show

Comments

Guilherme Salgado - Feb. 15, 2011, 12:30 p.m.
Without that templates will crash as they reference patwhork.<module>
directly.

Also removes the patchwork.wsgi symlink from the root and use the real file in
patchwork.wsgi.conf instead, as suggested by Dirk Wallenstein.

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
---
 lib/apache2/patchwork.wsgi      |    4 +++-
 lib/apache2/patchwork.wsgi.conf |    2 +-
 patchwork.wsgi                  |    1 -
 3 files changed, 4 insertions(+), 3 deletions(-)
 delete mode 120000 patchwork.wsgi

\ No newline at end of file

Patch

diff --git a/lib/apache2/patchwork.wsgi b/lib/apache2/patchwork.wsgi
index 0488b48..869bb9d 100644
--- a/lib/apache2/patchwork.wsgi
+++ b/lib/apache2/patchwork.wsgi
@@ -9,8 +9,10 @@ 
 import os
 import sys
 
-basedir = os.path.dirname(__file__)
+basedir = os.path.join(
+    os.path.dirname(__file__), os.path.pardir, os.path.pardir)
 sys.path.append(basedir)
+sys.path.append(os.path.join(basedir, 'apps'))
 
 os.environ['DJANGO_SETTINGS_MODULE'] = 'apps.settings'
 import django.core.handlers.wsgi
diff --git a/lib/apache2/patchwork.wsgi.conf b/lib/apache2/patchwork.wsgi.conf
index e99f8c6..3756e5a 100644
--- a/lib/apache2/patchwork.wsgi.conf
+++ b/lib/apache2/patchwork.wsgi.conf
@@ -16,5 +16,5 @@ 
         </Directory>
 </IfModule>
 
-WSGIScriptAlias / "/srv/patchwork/patchwork.wsgi"
+WSGIScriptAlias / "/srv/patchwork/lib/apache2/patchwork.wsgi"
 WSGIPassAuthorization On
diff --git a/patchwork.wsgi b/patchwork.wsgi
deleted file mode 120000
index cf13d18..0000000
--- a/patchwork.wsgi
+++ /dev/null
@@ -1 +0,0 @@ 
-lib/apache2/patchwork.wsgi