views:

94

answers:

1

I'm saving an user's default language in his user profile and on login I want to set the admin's default language to it.

One possibility I was thinking of is using a middleware, but I think if I do it on process_request I will not see an user object there since this is processed AFTER the middleware, so I could only set it after the next request!
Any solutions are highly appreciated!

A: 

The sad thing is Django doesn't send any signals on Login/Logout (apparently there's a ticket open for that at http://code.djangoproject.com/ticket/5612).

But looking around I found a rather simple and elegant solution for implementing signals on login/logout without touching Django's code: http://charlesleifer.com/blog/hooking-into-djangos-login-and-logout-two-approaches/

lazerscience