So, this app runs fine on two other machines (similar Fedora setup and
a Windows one), runs with "runserver", runs when I use "httpd -X" on
this machine. Even runs when I set PythonDebug = True. The problem
comes about when I have apache running in it's regular multithreaded
mode. I see several errors, the root of which appears to be below, and
a 500 error on the page:
[Thu Apr 20 15:51:28 2006] [error] [client 10.116.59.53] PythonHandler
django.core.handlers.modpython: ImproperlyConfigured: Could not load
database backend: No module named psycopg. Is your DATABASE_ENGINE
setting (currently, 'postgresql') spelled correctly? Available options
are: 'ado_mssql', 'mysql', 'postgresql', 'sqlite3'
I tried patching with Eugene's fix for #1442, but that didn't seem to
solve the problem (after a httpd restart, anyway). I also confirmed
that my sys.path setting seems okay from the python shell.
Any ideas what I am facing here? Or how to debug this?
-rob
I'd suggest switching to the "prefork" MPM for Apache; I've always
seen better performance and stability running Django under it as
opposed to the threaded one. Don't know if that's you're specific
issue, but everything else looks identical to our (working)
deployment architecture at work, so...
Jacob
For what it's worth, I think this advice should be in the documentation.
The documentation says "Apache with mod_python currently is the preferred
setup for using Django on a production server" but it doesn't explain
which MPM.
--
Richie Hindle
ric...@entrian.com
Good call. I've updated the docs.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
Unfortunately it doesn't solve the problem! I am using the vanilla
Fedora rpm for httpd which builds in prefork.c and has generally
default module directives. The funny behaviour is that it runs fine in
-X mode but doesn't run well with multiple forks. My mistake for naming
it multithreading, and sorry for not being clearer about that.
One difference I've found with my new server is that I am running
mod_python 3.2.8. On my old server I ran 3.1.4. I've also seen other
posts with people having similar problems, particularly on
http://www.djangoproject.com/documentation/modpython/
I started to rev back mod_python and ran into a few dependency
problems. I'll keep trying and see if that helps. Will let you know...
-rob
The REAL problem between my working (openhosting.com virtual) Fedora
system and this one was SELinux. Aarrgghh!
And of course I didn't have any problems in single user mode!
Thank you Yango for your comment on
http://www.djangoproject.com/documentation/modpython/
That's what I get for not using Red Hat for a few years... DDOS:
Dumbass Denial of Service
-rob