I saw this chat related to DJANGO_SETTINGS_MODULE is undefined.
Hello I am new to Django.
I am trying to exercise "templates" through the interactive shell,
however I end up getting this error. Can anyone help?
here is the exact steps I follow:
1) cd C:\Django\mysite
2) set DJANGO_SETTINGS_MODULE=mysite.settings I've also tried set
DJANGO_SETTINGS_MODULE=settings.py
3) python
4) >>> from django.template import Template
    >>> t = Template("My name is {{ name }}.")
5) ERROR: ImportError: Settings cannot be imported, because
environment variable DJANGO_SETTINGS_MODULE is undefined


- Show quoted text -

Setting it to mysite.settings will work if c:\django is on your
PYTHONPATH.
Setting it to settings.py won't work at all because of the .py.
Assuming
you are running the python from c:\django\mysite, setting
DJANGO_SETTINGS_MODULE to just 'settings' will work.  Or, use 'python
manage.py shell', which assumes settings.py is in the current
directory and
sets the environment up for you.
Karen



So I did

1
export PYTHONPATH=/usr/lib/python2.5/site-packages


2
set DJANGO_SETTINGS_MODULE=myapp1.settings


3
settings.py has :

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'myapp1.person',
)


when I do
django-admin.py dumpdata
Error: Settings cannot be imported, because environment variable
DJANGO_SETTINGS
_MODULE is undefined.
pubu...@pubuntu:~/django-trunk/build/lib/django/bin/mysite/myapp$





on the Django Congratulations screen it has myapp1
 what am I doing wrong?


--~--~---------~--~----~------------~-------~--~----~
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 at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to