an error about DJANGO_SETTINGS_MODULE

A

aimeixu

Hi,
I use python Django framework to make a bookmark website, when I
clicked login button on the user login page .and I import "from
django.contrib.auth.models import User" in the console,It will occur the
following error:Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/django/contrib/auth/models.py",
line 6, in ?
from django.db import models
File "/usr/lib/python2.4/site-packages/django/db/__init__.py", line
14, in ?
if not settings.DATABASES:
File "/usr/lib/python2.4/site-packages/django/utils/functional.py",
line 276, in __getattr__
self._setup()
File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line
38, 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.
'cause I am a newbie to python .Please help me find out where the error
is and how to solve this problem. Thanks a lot.
Best Wishes,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top