Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 13, 2011 06:36:44

N.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Meaning for this error


Hi all,

I wan to import a method in a model class to another
class as well as that method contains some objects includes self

How to import that method's operation?

it shows the error


>>> from users.models import userprofile
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/
models.py", line 6, in <module>
from django.db import models
File "/usr/local/lib/python2.6/dist-packages/django/db/__init__.py",
line 14, in <module>
if not settings.DATABASES:
File "/usr/local/lib/python2.6/dist-packages/django/utils/
functional.py", line 276, in __getattr__
self._setup()
File "/usr/local/lib/python2.6/dist-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.
>>>

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 13, 2011 12:02:19

Justin M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Meaning for this error


Are you using the Django python shell? That error means that your
environment doesn't point to a settings file, which is handled by the Django
shell.

Execute this command within your project directory (wherever you have the
manage.py file):
python manage.py shell

It will open a Python interpretor that automatically loads your project
settings, installed apps, and other Django infrastructure.

Also, make sure that Django installed on your pythonpath.

-Justin

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 16th of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support