pubu...@pubuntu:~/django-trunk/build/lib/django/bin/myapp1 export DJANGO_SETTINGS_MODULE=myapp1.settings export PYTHONPATH=/usr/lib/python2.5/site-packages django-admin.py dumpdata Error: Could not import settings 'myapp1.settings' (Is it on sys.path? Does it h ave syntax errors?): No module named myapp1.settings pubu...@pubuntu:~/django-trunk/build/lib/django/bin/myapp1$
my settings.py has ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'myapp1.person', ) pubu...@pubuntu:~/django-trunk/build/lib/django/bin/myapp1$ I tried doing export DJANGO_SETTINGS_MODULE=myapp1.person as in settings.py, but got same error. On May 7, 10:30 am, Sieker Adi Jörg <a...@sieker.info> wrote: > Hi, > > On 07.05.2009, at 16:02, bconnors wrote: > > > > > > > > > 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 > > The above is for windows and not unix. > > > > > > > - 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 > > This should be: export not set. > set is a window command and doesn't or does something different under > *nix. > > > > > 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?- Hide quoted text - > > - Show quoted text -- Hide quoted text - > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---