2👍
✅
Django 1.9 will have a PersistentRemoteUserMiddleware
, which will work when the authentication header is only present on the login page.
If you look at the patch, it shouldn’t be too hard to do something similar in Django 1.8. I would try overriding process_request
so that it doesn’t call self._remove_invalid_user(request)
to log out your user (that might end up duplicating a lot of code), or overriding _remove_invalid_user
itself.
Source:stackexchange.com