WebFaction
Community site: login faq

Django doesnt imports my apps from project root. Errors like this from apache logs:

ImportError: No module named loginza

All init.py files are in places;

Django 1.3. I already have another project with django 1.2, it works fine.

asked 19 Apr '11, 14:50

mynameis's gravatar image

mynameis
11
accept rate: 0%

Since loginza is probably an app inside your project and not a python package, you need to have the project name before it in the install_apps setting. Example= 'project.loginza',

(19 Apr '11, 15:47) timg ♦♦ timg's gravatar image

And now i have to rewrite all my imports? Is there other solution? Why in this project 'loginza' is not a python package and in another project it is?

(20 Apr '11, 00:09) mynameis mynameis's gravatar image

You need to add the full app path to the WSGIPythonPath Directive in apache's config. The reason your app is not a valid python module is because it is not located on the python path. What makes something a valid python module basically is "a directory on the python path with an init.py file in it".

(20 Apr '11, 00:12) johns ♦♦ johns's gravatar image

Thank you, i just added "/home/<username>/webapps/<project_name>/myproject" to WSGIPythonPath in httpd.conf. But in other projects it added automatically.

(20 Apr '11, 00:23) mynameis mynameis's gravatar image

It is normal for the path configuration requirements to be different between projects and to be configured upon deployment. Also depending on how old the other stacks are they might just have different default configuration.

(20 Apr '11, 00:32) johns ♦♦ johns's gravatar image
Be the first one to answer this question!
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:

×850
×104
×26

question asked: 19 Apr '11, 14:50

question was seen: 1,744 times

last updated: 20 Apr '11, 00:32

O
WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
SUITE 1, FIRST FLOOR, 41 CHALTON STREET, LONDON NW1 1JD, UNITED KINGDOM