WebFaction
Community site: login faq

Hi,

I am experiencing an issue similar to what's being discussed in this post - http://community.webfaction.com/questions/3249/django-import-error

Basically, my references are like from Cars.models import Car and this is giving an import error. I know i could add the project name to the start but that's a bit of work at this stage.

I tried modifying the httpd.conf file by adding in the below but it's not working (still getting an import error)

WSGIPythonPath /home/grimmus/webapps/coleborns/coleborns/

Any ideas ? Thanks

asked 05 Mar '12, 05:48

Grimmus
11
accept rate: 0%


To fix ImportErrors you need to add your project to the PYTHONPATH. The easiest way to do this is to add the sys.path to your wsgi file, for example:

sys.path = ['/home/username/webapps/djangoapp/myproject', '/home/username/webapps/djangoapp/lib/python2.5'] + sys.path

Once you add the above, be sure to restart your Django project.

permanent link

answered 05 Mar '12, 08:13

timg ♦♦
1.3k4
accept rate: 30%

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
×27

question asked: 05 Mar '12, 05:48

question was seen: 2,430 times

last updated: 05 Mar '12, 08:13

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 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