Extending @vikingosegundo's answer, if you want to get the username inside Models, I found a way that involves declaring a MiddleWare. Create a file called get_username.py inside your app, with this content:
from threading import current_thread
_requests = {}
def get_username():
t = current_thread()
if t not in _requests:
return None
return _requests[t]
class RequestMiddleware(object):
def process_request(self, request):
_requests[current_thread()] = request
Edit your settings.py and add it to the MIDDLEWARE_CLASSES: