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:

http://forum.webfaction.com/viewtopic.php?id=1875

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?

Thanks!

asked 21 Nov '10, 05:28

ColeVsCode's gravatar image

ColeVsCode
1111
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.

link

answered 21 Nov '10, 05:37

David%20L's gravatar image

David L ♦♦
1.4k13
accept rate: 44%

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×744

Asked: 21 Nov '10, 05:28

Seen: 9,512 times

Last updated: 21 Nov '10, 05:37

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited