Hello,

1) Test.py  complains about missing module
ImportError: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefin
ed.

I added lines to  python-support.pth file in /usr/lib/python2.5/site-
packages :
/opt/pages/referenc
/opt/pages/referenc/Aref
/opt/pages/referenc/settings.py

sys.path gives output containing:
 '/opt/pages/referenc',  '/opt/pages/referenc/Aref',  '/opt/pages/
referenc/settings.py'

working:/opt/pages/referenc# django-admin runserver --
settings=referenc.settings
Error: Could not import settings 'referenc.settings' (Is it on
sys.path? Does it have syntax errors?): No module named
referenc.settings

########### test.py#####################
#database   /opt/pages/referenc/referenc.db
#table         Aref_aref defined in ./referenc/models.py as module
Aref
#table         contains many columns, one of which is Rexperimental
#i am inserting empty string "" into column Rexperimental

from models import Aref

if(1==1) :
    from django.db import connection, transaction
    cursor = connection.cursor()
    str1='insert INTO Aref_aref (Rexperimental) values ("");'
    a=cursor.execute(str1)
    print 'a=', a
###############################

working:/opt/pages/referenc/Aref# python tests.py
Traceback (most recent call last):
  File "tests.py", line 2, in <module>
    from models import Aref
  File "/opt/pages/referenc/../referenc/Aref/models.py", line 1, in
<module>
    from django.db import models
  File "/usr/lib/python2.5/site-packages/django/db/__init__.py", line
10, in <module>
    if not settings.DATABASE_ENGINE:
  File "/usr/lib/python2.5/site-packages/django/utils/functional.py",
line 269, in __getattr__
    self._setup()
  File "/usr/lib/python2.5/site-packages/django/conf/__init__.py",
line 38, in _setup
    raise ImportError("Settings cannot be imported, because
environment variable %s is undefined." %
ENV                                   IRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefin
ed.





-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to