I have an auth-backend inheriting from model backend that works on 1.3.x and 1.4.x but does not work on 1.5.x. The only difference between the systems is the version of Django.
After much comparing and cursing and tearing of hair, it turns out what has changed is how Django behaves under mod_wsgi with WSGIDaemonProcess under Apache 2.2.22 prefork.
This works regardless:
WSGIDaemonProcess foo processes=1 threads=20 ...
WSGIDaemonProcess foo processes=1 threads=1 ...
WSGIDaemonProcess foo threads=1 ...
WSGIDaemonProcess foo ...
This no longer works with Django 1.5:
WSGIDaemonProcess foo processes=20 threads=20 ...
WSGIDaemonProcess foo processes=20 threads=1 ...
WSGIDaemonProcess foo processes=20 ...
The system is supposed to be running with
WSGIDaemonProcess foo processes=20 threads=20 ...
In sum: threading is ok, multiple processes is not. Furthermore, the default RemoteUserBackend works, the one inheriting from ModelBackend does not.
The problem seems to be that after successful authenticatiion and login, the session (cookies) isn't changed, since after a redirect, request.user is AnonymousUser.
According to
http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading, how processes/threads are set up affects how shared data (globals, like module variables) are treated. I'm therefore wondering if somehing changed in how Django's wsgi deals with globals, or if there is change in globals usage in the auth backend system that will account for this.
Before I start making a publishable minimal version of the login backend that still fails, I'd like to know: