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

Tags:

×742
×88
×25

Asked: 19 Apr '11, 14:50

Seen: 1,138 times

Last updated: 20 Apr '11, 00: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