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 |
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',
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?
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".
Thank you, i just added "/home/<username>/webapps/<project_name>/myproject" to WSGIPythonPath in httpd.conf. But in other projects it added automatically.
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.