Reputation: 2189
I have tried so hard to make this work but it is not working. I have read myriads of answers here in SO but it's been futile.
I installed Python 2.7 and Django 1.6.5. I have created a virtualenv
, env where I created my project and app as well. The Django Server is running fine after installing MySQL-python
and running manage syncdb
that created all the apps in INSTALLED_APPS but if I try to from django.db import models
it says:
ImportError: Could not import settings 'mywebsite.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named mywebsite.settings
I created a Path
in Environment Variables in System variables. Variable name is DJANGO_SETTINGS_MODULE
and its value is mywebsite.settings
.
What am I doing wrong?
Upvotes: 0
Views: 870
Reputation: 7631
You can either run python manage.py runserver
from the same directory as your settings.py (that is mywebsite), or you should export PYTHONPATH to have mywebsite.settings in the path by export PYTHONPATH=$PYTHONPATH:<path_to_mywebsite>
(for a unix system)
For windows take a look at how to add to pythonpath in windows
Upvotes: 1