tomchristie/django-rest-framework — pull request #2155 by martinmaillard (2014-11-28 20:24:27+00:00)
Title: Set authenticated user on wrapped request

Because of the way DRF handles authentication, middleware classes don't have access to the currently authenticated user. If we set the user on the wrapped request during authentication, middleware classes can at least access it in the `process_response` method.

I'm not aware of all the implications of doing that, so this PR is mostly meant to start a discussion.

I use DRF in several projects and I met this issue at least twice while trying to integrate with other libraries. I realize there is a reason why the authentication is not handled in DRF as it is in django, but I think it is worth exploring possible solutions to mitigate the issues that it can cause.