Hi, I had a heck of a time tracking down the cause of this error:

TemplateSyntaxError: Caught ImportError while rendering: No module named myApp

I found some relevant stuff here:


but it took me a while to figure out that I needed to fully qualify my app's name (as in project.myapp) throughout my project

The forum post above suggested that an overly permissive PYTHONPATH is the culprit. However, on my macosx system, I don't have a PYTHONPATH environment variable. I'd like to know how to recreate the conditions on my home system that better reflect the webfaction environment. Specifically how do I make my app break at home the same way it was breaking on webfaction?


asked 21 Nov '10, 05:28

ColeVsCode's gravatar image

accept rate: 0%

The PYTHONPATH is not always defined in an environment variable. It can also be edited directly in code by editing sys.path (as you most likely know).

Your local development environment probably already has your project in your PYTHONPATH. Rather than breaking your local environment, you'd be better off fixing your production environment.

In your httpd.conf (or your WSGI file) make sure that the path to your project is in your WSGIPythonPath line. For example:

WSGIPythonPath /home/username/webapps/app/my_project:/home/username/webapps/my_app/lib/python2.6

Now you'll be able to just say myapp in place of project.myapp.

permanent link

answered 21 Nov '10, 05:37

David%20L's gravatar image

David L ♦♦
accept rate: 45%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 21 Nov '10, 05:28

question was seen: 10,749 times

last updated: 21 Nov '10, 05:37

Features & prices    Sign up    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
© Copyright 2003-2015 Swarma Limited - WebFaction is a service of Swarma Limited