title: Django: user login not working
body: <p>This is my login view:</p>
  
  <pre><code>def dashboard(request):
      return render(request, 'dashboard.html', {})
  
  def user_login(request):
      if request.user.is_authenticated():
          HttpResponseRedirect('/dashboard')
  
      if request.method == 'POST':
          username = request.POST.get('username')
          password = request.POST.get('password')
  
          user = authenticate(username=username, password=password)
  
          if user:
              if user.is_active:
                  return HttpResponseRedirect('/dashboard')
              else:
                  return HttpResponse("Your account is disabled.")
          else:
              print "Invalid login details: {0}, {1}".format(username, password)
              return HttpResponse("Invalid login details.")
  
      else:
          return render(request, 'login.html', {})
  </code></pre>
  
  <p>Now, when I enter correct login info, it redirects me properly, to /dashboard, but I'm still not logged in. What am I missing?</p>