Hi Thomas, When I typed the following into my python console as advised: >>> from django.contrib.session.backends import db I got the following error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/contrib/sessions/backends/db.py", line 2, in <module> from django.contrib.sessions.models import Session File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/contrib/sessions/models.py", line 4, in <module> from django.db import models File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/db/__init__.py", line 10, in <module> if not settings.DATABASE_ENGINE: File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/utils/functional.py", line 269, in __getattr__ self._setup() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/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. I searched "/Users/myname/mysite3/settings.py" for the variable SESSION_ENGINE but it is not defined in that file. I don't know where settings.SESSION_ENGINE is defined??? Simon
--- On Mon, 8/24/09, Thomas Guettler <h...@tbz-pariv.de> wrote: From: Thomas Guettler <h...@tbz-pariv.de> Subject: Re: Error in setting up psycopg2 To: "Simon Lee" <hago...@yahoo.com>, django-users@googlegroups.com Date: Monday, August 24, 2009, 11:17 PM Hi Simon, your first traceback looked like this: [Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1] mod_wsgi (pid=120): Exception occurred processing WSGI script '/Users/myname/ mysite3/apache/myapp.wsgi'. [Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1] Traceback (most recent call last): [Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1] File "/Users/ myname/mysite3/django/core/handlers/wsgi.py", line 239, in __call__ [Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1] File "/Users/ myname/mysite3/django/core/handlers/base.py", line 67, in get_response [Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1] File "/Users/ myname/mysite3/django/contrib/sessions/middleware.py", line 9, in process_request [Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1] ImportError: No module named db My line 9 of middleware.py of sessions looks like this: engine = __import__(settings.SESSION_ENGINE, {}, {}, ['']) What does your variable settings.SESSION_ENGINE look like? Is it 'django.contrib.sessions.backends.db'? Try to import this as www user: w...@host> python >>> from django.contrib.session.backends import db Does this work? Simon Lee schrieb: > You are right. I am a newbie on Linux, trying hard to learn it at the > same time with the other stuff. > > I did the following in the shell: > > macbook:~myname$ su > Password: <enter my root password> > sh-3.2# su - _www > sh-3.2# more /Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/psycopg2/tz.py > > I can read the file with more. Seems that there is no problem on > permission. Please advise. > -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---