title: Django & Allauth Login Redirect Issue
body: <p>For some reason after login the page doesn't redirect to where LOGIN_REDIRECT_URL points but remains on a blank page /accounts/login/ with code 200. So, after login I get a blank page and have to refresh (F5) to get to my LOGIN_REDIRECT_URL. After the refresh I am successfuly loged in.</p>
  
  <p>ACCOUNT_LOGOUT_REDIRECT_URL works fine, returns code 302 and redirects directly without a blank page but LOGIN_REDIRECT_URL doesn't. If I change the LOGIN_REDIRECT_URL after refresh I am redirected to the changed location, this works fine. But first I am always stuck on a blank page /accounts/login/. Can't find out why this happens.</p>
  
  <p>There is no error message, I haven't find any issue in the AllAuth LoginView.</p>
  
  <p>There is not much code to show, this is built-in django and allauth functionality that i have successfuly used in other apps on lesser django version, this is my first project with django 1.10.1. It is also my first mobile project with jquery mobile functionality. So here is my settings:</p>
  
  <pre><code>DEBUG = True
  
  ALLOWED_HOSTS = ['*']
  SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  
  INSTALLED_APPS = [
  'django.contrib.auth',
  'django.contrib.contenttypes',
  'django.contrib.sessions',
  'django.contrib.messages',
  'django.contrib.staticfiles',
  
  'django.contrib.sites',
  #'django.contrib.flatpages',
  
  'appconf',
  'avatar',
  'myApp',
  
  'allauth',
  'allauth.account',
  'allauth.socialaccount',
  'allauth.socialaccount.providers.facebook',
  'allauth.socialaccount.providers.google',
  
  'django.contrib.admin',
  
  'lockdown',
  
  ]
  
  MIDDLEWARE_CLASSES = [
  'django.middleware.security.SecurityMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.middleware.common.CommonMiddleware',
  'django.middleware.csrf.CsrfViewMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  'django.contrib.messages.middleware.MessageMiddleware',
  'django.middleware.clickjacking.XFrameOptionsMiddleware',
  #'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
  'lockdown.middleware.LockdownMiddleware',
  
  ]
  
  LOGIN_REDIRECT_URL = '/'
  ACCOUNT_LOGOUT_REDIRECT_URL = '/'
  </code></pre>
  
  <p>This is the login form:</p>
  
  <pre><code>&lt;a class="login_link" href="#popupLogin" data-rel="popup" data-position-to="window" class="" data-transition="pop"&gt;Login&lt;/a&gt;
  &lt;div data-role="popup" id="popupLogin" data-theme="a" class="ui-corner-all"&gt;
  &lt;form id="login_form" method="POST" action="{% url 'account_login' %}"&gt;
      {% csrf_token %}
      &lt;div style="padding:10px 20px;"&gt;
          &lt;h3&gt;Please sign in&lt;/h3&gt;
          {{loginForm.login}}
          {{loginForm.password}}
            {% if redirect_field_value %}
                &lt;input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" /&gt;
            {% endif %}
            &lt;button type="submit" class="ui-btn ui-corner-all ui-shadow ui-btn-b ui-btn-icon-left"&gt;Sign in&lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  {% if loginForm.errors %}
      {% for field in loginForm %}
          {% for error in field.errors %}
              &lt;div class="alert alert-danger"&gt;
                  &lt;strong&gt;{{ error|escape }}&lt;/strong&gt;
              &lt;/div&gt;
          {% endfor %}
      {% endfor %}
      {% for error in loginForm.non_field_errors %}
          &lt;div class="alert alert-danger"&gt;
              &lt;strong&gt;{{ error|escape }}&lt;/strong&gt;
          &lt;/div&gt;
      {% endfor %}
  {% endif %}
  
  &lt;/div&gt;
  </code></pre>
  
  <p>And here is what happens in terminal:</p>
  
  <p>Logout:</p>
  
  <pre><code>[14/Sep/2016 06:36:18] "POST /accounts/logout/ HTTP/1.1" 302 0
  [14/Sep/2016 06:36:24] "GET / HTTP/1.1" 200 12295
  </code></pre>
  
  <p>Login:</p>
  
  <pre><code>[14/Sep/2016 06:36:34] "POST /accounts/login/ HTTP/1.1" 200 46
  </code></pre>
  
  <p>Manual refresh after login:</p>
  
  <pre><code>[14/Sep/2016 06:37:00] "GET /accounts/login/ HTTP/1.1" 302 0
  [14/Sep/2016 06:37:00] "GET / HTTP/1.1" 200 11434
  </code></pre>
  
  <p><strong>UPDATE</strong>
  The same issue appears when using allauth for account signup. The url accounts/signup/ is a blank page that needs to be refreshed in order to redirect to the actual template containing the signup form. I have still not solved it.</p>