You need to set two things
DJANGO_SETTINGS_MODULE
andPYTHONPATH
so that the settings module can be found
The way Two Scoops of Django suggests setting up a project named blah
you would have the following directory structure:
- blah_project/
- blah/
- manage.py
- blah/
- ...
- settings/
- __init__.py
- local.py
- production.py
- ...
Run the following (assuming a bash
environment):
export DJANGO_SETTINGS_MODULE=blah.settings.local
export PYTHONPATH=/full/path/to/blah_project/blah
As long as django-admin.py
is on your path (and it should be if django
is installed and activated within your venv
), you should be able to run:
django-admin.py runserver