I setup a mezzanine project successfully.
In the settings.py (Python2.7) consol :
>>> mezzanine.pages.models import Page
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/mezzanine/pages/models.py", line 2, in <module>
from django.db import models
File "/usr/local/lib/python2.7/site-packages/django/db/__init__.py", line 14, in <module>
if not settings.DATABASES:
File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py", line 276, in __getattr__
self._setup()
File "/usr/local/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.
Why this error?
DJANGO_SETTINGS_MODULE variable has been set up :
# +++++++++++ DJANGO +++++++++++
# To use your own django app use code like this:
import os
import sys
## assuming your django settings file is at '/home/myname/mysite/settings.py'
path = '/home/sligozat/'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'nettementvotre.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()