Missing basedir/apps in sys.path?

Guilherme Salgado guilherme.salgado at linaro.org
Thu Feb 3 06:16:10 EST 2011


Hi there,

I've just followed the instructions to deploy patchwork and everything
seemed to work fine but when I went to /admin on my browser I got the
following error:

  TemplateSyntaxError: Caught ImportError while rendering: No module named patchwork

Which seems to happen because templates reference the patchwork module
directly (e.g. 'patchwork.views.') but in patchwork.wsgi only the
basedir is added to sys.path, so you'd in fact have to reference that
using 'apps.patchwork.views', so I was wondering if the patch below
would make sense?

Cheers,

--- a/lib/apache2/patchwork.wsgi
+++ b/lib/apache2/patchwork.wsgi
@@ -11,6 +11,7 @@ import sys
 
 basedir = os.path.dirname(__file__)
 sys.path.append(basedir)
+sys.path.append(os.path.join(basedir, 'apps'))
 
 os.environ['DJANGO_SETTINGS_MODULE'] = 'apps.settings'
 import django.core.handlers.wsgi


-- 
Guilherme Salgado <https://launchpad.net/~salgado>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/patchwork/attachments/20110202/033f852b/attachment.pgp>


More information about the Patchwork mailing list