I'm running the server using python manage.py runserver. And I get this error that I'm not quite understanding how to sort out:
Traceback (most recent call last):
File "manage.py", line 1, in <module>
from polls.models import Poll
File "/Users/davidhaddad/Desktop/mysite/polls/models.py", line 2, in <module>
from django.db import models
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/__init__.py", line 11, in <module>
if DEFAULT_DB_ALIAS not in settings.DATABASES:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
self._setup()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py", line 40, in _setup
raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.
settings.py was visible earlier and I started getting this message after I added some code to register a few app models with admin.
To give some more info: when I do export DJANGO_SETTINGS_MODULE=settings from inside the project directory and then i do python django-admin.py runserver the server doesn't run