Just a suggestion, not sure if this is the best way to go about it,
but you could create a custom Middleware class, override the
process_request method, and insert it in your MIDDLEWARE_CLASSES list
(in settings.py), somewhere after the AuthenticationMiddleware.
- Kevin