admin - Configuration error in django -
i using django mod_python (i know deprecated -- doing exercise), , getting following error --
"could not import project.views. error was: no module named app.models"
i getting 'no module named app.models"
in several other places well. syncdb
working fine, , if go manage.py shell
can import models fine. why occurring , need change? thank you.
you should use absolute imports everywhere. if project structured so:
/project/settings.py /project/app/models.py /project/app/views.py
in installed_apps
use project.app
. in app
you'd import models views: import project.app.models
, etc. alternately can try adjusting pythonpath
imports work. when run ./manage.py
in project folder, , python automatically adds pythonpath
. doesn't happen automatically in deployment scenarios (mod_python
or other wise).
Comments
Post a Comment