I'm trying to replicate my (working ok) winxp testing environment on openSuSE 11.1 with Apache2 as a parallel testing environment. We're nowhere near production at the moment.
The problem I'm having on openSuSE when i try /usr/bin/python /srv/www/vhosts/ccm/climate/ccm/tests.py is ... Traceback (most recent call last): File "/srv/www/vhosts/ccm/climate/ccm/tests.py", line 7, in <module> from django.contrib.auth.models import User File "/usr/lib64/python2.6/site-packages/django/contrib/auth/models.py", line 6, in <module> from django.db import models File "/usr/lib64/python2.6/site-packages/django/db/__init__.py", line 10, in <module> if not settings.DATABASE_ENGINE: File "/usr/lib64/python2.6/site-packages/django/utils/functional.py", line 268, in __getattr__ self._setup() File "/usr/lib64/python2.6/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. ... BUT ... in /etc/pythonstart <at the beginning of the file> import sys sys.path.append('/srv/www/vhosts/ccm') <snipped balance which is untouched> ... AND ... in /etc/profile.local export DJANGO_SETTINGS_MODULE=climate.settings Then after restarting the computer, os.environ includes ... 'DJANGO_SETTINGS_MODULE': 'climate.settings', ... among all the other environment variables. Physically, the settings file is ... /srv/www/vhosts/ccm/climate/settings.py ... and I can launch /usr/bin/python (2.6.0 as provided by openSuSE 11.1) and prove /srv/www/vhosts/ccm/ is on the pythonpath by doing ... ~>/usr/bin/python Python 2.6 (r26:66714, Feb 3 2009, 20:49:49) [GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import climate.settings ldaps://192.168.0.188:636 >>> ... where the above output is embedded in a print statement in settings.py and proves there are no syntax errors in settings.py I have also tried all the above as root and get the same results so I don't think it is a permissions thing. Can any kind person see where I'm going wrong? Thanks Mike --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---