I'm having problems getting Django to work with Apache. Evenything
works with "./manage.py runserver", but I get the errors listed below
when I try to load the project with Apache and mod_python.

I consistently get the same error the first and second refresh,
followed by the "Third+" the rest of the time (until I restart Apache).

Versions of stuff:
 Django latest svn
 Python 2.3.5
 Apache 2.0.52
 mod_python 3.1.3
 PostgreSQL 7.4.13
 psycopg 1.1.21

########################
# First and second refresh
########################

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line
299, in HandlerDispatch
    result = object(req)

  File
"/usr/lib/python2.3/site-packages/django/core/handlers/modpython.py",
line 163, in handler
    return ModPythonHandler()(req)

  File
"/usr/lib/python2.3/site-packages/django/core/handlers/modpython.py",
line 131, in __call__
    self.load_middleware()

  File "/usr/lib/python2.3/site-packages/django/core/handlers/base.py",
line 29, in load_middleware
    mod = __import__(mw_module, '', '', [''])

  File
"/usr/lib/python2.3/site-packages/django/contrib/sessions/middleware.py",
line 2, in ?
    from django.contrib.sessions.models import Session

  File
"/usr/lib/python2.3/site-packages/django/contrib/sessions/models.py",
line 3, in ?
    from django.db import models

  File "/usr/lib/python2.3/site-packages/django/db/__init__.py", line
11, in ?
    backend = __import__('django.db.backends.%s.base' %
settings.DATABASE_ENGINE, '', '', [''])

  File
"/usr/lib/python2.3/site-packages/django/db/backends/postgresql/base.py",
line 12, in ?
    raise ImproperlyConfigured, "Error loading psycopg module: %s" % e

ImproperlyConfigured: Error loading psycopg module: No module named
DateTime

########################
# Third+ refreshes
########################

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line
299, in HandlerDispatch
    result = object(req)

  File
"/usr/lib/python2.3/site-packages/django/core/handlers/modpython.py",
line 163, in handler
    return ModPythonHandler()(req)

  File
"/usr/lib/python2.3/site-packages/django/core/handlers/modpython.py",
line 131, in __call__
    self.load_middleware()

  File "/usr/lib/python2.3/site-packages/django/core/handlers/base.py",
line 35, in load_middleware
    raise exceptions.ImproperlyConfigured, 'Middleware module "%s" does
not define a "%s" class' % (mw_module, mw_classname)

ImproperlyConfigured: Middleware module
"django.contrib.sessions.middleware" does not define a
"SessionMiddleware" class

########################
# relevant http.conf
########################

<VirtualHost 127.0.0.1>
    ServerName example.com
    ServerAlias www.example.com

    # My project's name is 'example' and the project folder is located
in /home/web/pro/
    PythonPath "['/home/web/pro/'] + sys.path"
    # PythonPath "['/home/web/pro'] + sys.path" #tried just in case it
matters

    SetHandler python-program
    # SetHandler mod_python # tried this too
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE example.settings
    PythonDebug On

</VirtualHost>

########################
# python path
########################

[EMAIL PROTECTED] ./manage.py shell
Python 2.3.5 (#1, Aug 25 2005, 09:17:44)
(InteractiveConsole)
>>> import sys
>>> sys.path
['/home/web/pro/example', '/usr/lib/python23.zip',
'/usr/lib/python2.3', '/usr/lib/python2.3/plat-linux2',
'/usr/lib/python2.3/lib-tk', '/usr/lib/python2.3/lib-dynload',
'/usr/lib/python2.3/site-packages',
'/usr/lib/python2.3/site-packages/PIL']

########################
# DateTime exists
########################

[EMAIL PROTECTED] ls /usr/lib/python2.3/site-packages/mx/DateTime/
ARPA.py       Doc         ISO.pyo         Locale.pyo  Parser.py
__init__.py
ARPA.pyc      Examples    LICENSE         NIST.py     Parser.pyc
__init__.pyc
ARPA.pyo      Feasts.py   LazyModule.py   NIST.pyc    Parser.pyo
__init__.pyo
COPYRIGHT     Feasts.pyc  LazyModule.pyc  NIST.pyo    README
mxDateTime
DateTime.py   Feasts.pyo  LazyModule.pyo  ODMG.py     Timezone.py
timegm.py
DateTime.pyc  ISO.py      Locale.py       ODMG.pyc    Timezone.pyc
timegm.pyc
DateTime.pyo  ISO.pyc     Locale.pyc      ODMG.pyo    Timezone.pyo
timegm.pyo

########################
# version of psycopg
########################

[EMAIL PROTECTED] strings
/usr/lib/python2.3/site-packages/psycopgmodule.so | grep -B 1 version
1.1.21
__version__


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to