title: I have a problem with the django authenticate function
body: <p>When I input the same username and password as in the database it shows "invalid credentials" instead of "Success".</p>
  
  <p>def login(request):
      if request.method  == 'POST':</p>
  
  <pre><code>    username           = request.POST.get('user')
      password1          = request.POST.get('password1')
      a                  = authenticate( username=username, password=password1)
      if a is not None:
          return HttpResponse("Success")
      else:
          return HttpResponse("Invalid Credentials")
  return render(request, 'login.html')
  </code></pre>