On 08/04/2010 08:32 PM, Tony wrote:
Hi, Im trying to import my models to another python file that I am making to use the database data. The problem is, I can't import the models for some reason. It keeps saying "ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined." The thing is, the script works on my home computer when I do it, but when I do it on webfaction this seems to happen. Anyone ever have a similar problem? And I have tried including various paths in the py file with sys.path.append() but that hasnt worked. Disregard my first message, this is actually what the error is.
That environment variable DJANGO_SETTINGS_MODULE is probably defined on your home computer but not on webfaction. You use it to point django at your "mysite/settings.py" file so that it knows which settings to use.
See http://docs.djangoproject.com/en/dev/topics/settings/#designating-the-settings
Reinout -- Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org Programmer at http://www.nelen-schuurmans.nl "Military engineers build missiles. Civil engineers build targets" -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.