From patchwork Wed Feb 2 19:16:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Missing basedir/apps in sys.path? Date: Wed, 02 Feb 2011 09:16:10 -0000 From: Guilherme Salgado X-Patchwork-Id: 81519 Message-Id: <1296674170.2552.31.camel@feioso> To: patchwork@lists.ozlabs.org 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