

def process_request(self, request):
    if (not hasattr(request, 'user')):
        raise ImproperlyConfigured("The Django remote user auth middleware requires the authentication middleware to be installed.  Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.auth.middleware.AuthenticationMiddleware' before the RemoteUserMiddleware class.")
    try:
        username = request.META[self.header]
    except KeyError:
        if (self.force_logout_if_no_header and request.user.is_authenticated):
            self._remove_invalid_user(request)
        return
    if request.user.is_authenticated:
        if (request.user.get_username() == self.clean_username(username, request)):
            return
        else:
            self._remove_invalid_user(request)
    user = auth.authenticate(remote_user=username)
    if user:
        request.user = user
        auth.login(request, username)

dataset/ETHPy150Open django/django/django/contrib/auth/middleware.py RemoteUserMiddleware.process_request/VarMisuse@154/250 `user`->`username`