From patchwork Wed Feb 2 19:16:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guilherme Salgado X-Patchwork-Id: 81519 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id BEADCB7107 for ; Thu, 3 Feb 2011 06:16:23 +1100 (EST) Received: from mail-yw0-f51.google.com (mail-yw0-f51.google.com [209.85.213.51]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 309F4B70EA for ; Thu, 3 Feb 2011 06:16:20 +1100 (EST) Received: by ywe10 with SMTP id 10so159695ywe.38 for ; Wed, 02 Feb 2011 11:16:16 -0800 (PST) Received: by 10.91.55.8 with SMTP id h8mr12739634agk.145.1296674175588; Wed, 02 Feb 2011 11:16:15 -0800 (PST) Received: from [192.168.1.103] ([187.126.150.244]) by mx.google.com with ESMTPS id p14sm6986644ank.34.2011.02.02.11.16.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Feb 2011 11:16:14 -0800 (PST) Subject: Missing basedir/apps in sys.path? From: Guilherme Salgado To: patchwork@lists.ozlabs.org Date: Wed, 02 Feb 2011 17:16:10 -0200 Message-ID: <1296674170.2552.31.camel@feioso> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@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