title: Django - Authentication using REMOTE_USER - How to test in dev server?
body: <p>I want to use django.contrib.auth.middleware.RemoteUserMiddleware for authentication as outlined here:</p>
  
  <p><a href="https://docs.djangoproject.com/en/dev/howto/auth-remote-user/" rel="noreferrer">https://docs.djangoproject.com/en/dev/howto/auth-remote-user/</a></p>
  
  <p>Question is, how can I test this in a dev environment where there is no Apache? i.e. can I set REMOTE_USER somehow in local settings?</p>
  
  <p><strong>EDIT</strong> (adding settings)</p>
  
  <pre><code>AUTHENTICATION_BACKENDS = (
  'django.contrib.auth.backends.RemoteUserBackend',
  )
  
  MIDDLEWARE_CLASSES = (
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.auth.middleware.RemoteUserMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
  )
  
  INSTALLED_APPS = (
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      ...
  )
  </code></pre>
  
  <p>Then I have this in my local_Settings: </p>
  
  <pre><code>os.environ['REMOTE_USER'] = "mmatyas"
  </code></pre>
  
  <p>I also tried the 'HTTP_REMOTE_USER' variant. Thanks!</p>