WebFaction
Community site: login 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 09 Feb '12, 11:17

Steve
34
accept rate: 0%


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.

permanent link

answered 09 Feb '12, 11:37

timg ♦♦
1.3k4
accept rate: 30%

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

(09 Feb '12, 11:43) Steve

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.

(09 Feb '12, 11:46) timg ♦♦

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?

(09 Feb '12, 11:56) Steve

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

(09 Feb '12, 12:32) timg ♦♦
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

Question tags:

×909
×337
×54
×27
×13

question asked: 09 Feb '12, 11:17

question was seen: 2,490 times

last updated: 09 Feb '12, 12:32

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM