login community 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 Apr 19 '11 at 14:50

mynameis's gravatar image

mynameis
1

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',

(Apr 19 '11 at 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?

(Apr 20 '11 at 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".

(Apr 20 '11 at 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.

(Apr 20 '11 at 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.

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

×641
×72
×19

Asked: Apr 19 '11 at 14:50

Seen: 823 times

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