title: Django Not Redirecting to Admin Site after Login
body: <p>I needed one more login form field to login django admin. I overridden AdminSite.login_form</p>
  
  <p>CODE:forms.py</p>
  
  <pre><code>from django.contrib.admin.forms import AdminAuthenticationForm
  from django import forms
  from django.contrib.admin.sites import AdminSite
  
      class ModifiedForm(AdminAuthenticationForm):
          auth_fact = forms.CharField(max_length=64,required=False)
  
      AdminSite.login_form = ModifiedForm
  </code></pre>
  
  <p>Then I rendered this from,
  CODE: views.py</p>
  
  <pre><code>def login_test(request):
  if request.method == "POST":
      form = ModifiedForm(request.POST)
      if form.is_valid():
          username = form.cleaned_data['username']
          password = form.cleaned_data['password']
          auth_fact= form.cleaned_data['auth_fact']
  return render_to_response('admin/login.html',{'form':ModifiedForm}
  </code></pre>
  
  <p>And I created a template as well in templates/admin/login.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;p&gt;Login Page&lt;/p&gt;
  
      &lt;div class="row-fluid"&gt;
          &lt;div class="span12"&gt;
  
      &lt;form action="" method="POST"&gt;{% csrf_token %}
          &lt;table&gt;
          {{ form.as_table }}
          &lt;/table&gt;
  &lt;p style="margin-left:7%;"&gt;&lt;small style="color: red;"&gt;example:product name,mfg date,exp date,batch no.&lt;/small&gt;&lt;/p&gt;
  &lt;input style="margin-left:10%" class="btn btn-primary" type="submit" name="release" value="Update Product Details "/&gt;
      &lt;/form&gt;
  
      &lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>All is working fine, I can submit login form. But I redirects me to the page:</p>
  
  <p><a href="http://example.com/accounts/profile/" rel="nofollow">http://example.com/accounts/profile/</a></p>
  
  <p>And I am getting page not found error,but if put <a href="http://excample.com/admin" rel="nofollow">http://excample.com/admin</a> in URL it shows me logged in and I can see admin site.</p>
  
  <p>Basically I am able to login but its not redirecting me to admin page.</p>
  
  <p>Any fix to this....</p>