Reputation: 590
something strange occurs on my Ubuntu 12.10. I have the following directory structure for my Django project:
project-repository
|__ my-project
|__manage.py
|__my-project
|__ __init__.py
|__urls.py
|__wsgi.py
|__settings
|__ __init__.py
|__local.py
|__base.py
When I run from within project-repository/my-project
django-admin runserver --pythonpath=$PWD --settings=my-project.settings.local
everything works perfectly.
But when I try to add project-repository/my-project
to virtualenv via add2virtualenv $PWD
the following command
django-admin runserver --settings=my-project.settings.local
results in the following error:
ImportError: Could not import settings 'my-project.settings.local' (Is it on sys.path?): No module named my-project.settings.local
Although when I do sys.path
in python console, one of the lines corresponds to the project-repository/my-project
directory.
Could you please clarify me what I'm doing wrong?
Upvotes: 1
Views: 890
Reputation: 590
It occurred that I used the globally installed django-admin.py while trying to work with one installed in virtualenv. More details are here https://stackoverflow.com/a/14768107/897301.
Upvotes: 1