login community faq

I've noticed that after I uploaded my django site from my local copy to the production (live site) I keep getting this error in my django error log.

ImportError: No module named injury.models

Why would I be getting this, its a standard app I made in my project?

Any help in fixing this would be greatly appreciated.

asked Feb 09 '12 at 11:17

Steve's gravatar image

Steve
32


To fix ImportErrors you need to make sure the module is on your PYTHONPATH.
There are several ways to do this in our Fixing ImportError Exceptions documentation.

answered Feb 09 '12 at 11:37

timg's gravatar image

timg ♦♦
4714

Im relatively new to moving to production servers, etc.

For adding the module to the python path, do I add a new line and add it there or how do I go about it?

Thanks

(Feb 09 '12 at 11:43) Steve Steve's gravatar image

This depends on which of the methods you choice to add the path. I would recommend using the wsgi method and use this syntax:
sys.path = ["path_to_module1", "path_to_module2"] + sys.path

Once you have added the path, be sure to restart apache to pick up the change.

(Feb 09 '12 at 11:46) timg ♦♦ timg's gravatar image

Ok I added this: sys.path = ["/home/username/webapps/django/injurybug/injury", "/home/username/webapps/django/injurybug/dash"] + sys.path

but still getting the same issue.

Am I missing something?

(Feb 09 '12 at 11:56) Steve Steve's gravatar image

Please open a support ticket so we can look at the files in more detail.

(Feb 09 '12 at 12:32) timg ♦♦ timg's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
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

Tags:

×643
×229
×47
×19
×10

Asked: Feb 09 '12 at 11:17

Seen: 670 times

Last updated: Feb 09 '12 at 12:32

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