title: check_password always returning false even if the password is correct?
body: <p>I am using Django 1.5. I am a custom User model like this:</p>
  
  <pre><code>class User(AbstractBaseUser):
      #id = models.IntegerField(primary_key=True)
      #identifier = models.CharField(max_length=40, unique=True, db_index=True)
      username = models.CharField(max_length=90, unique=True, db_index=True)
      create_time = models.DateTimeField(null=True, blank=True)
      update_time = models.DateTimeField(null=True, blank=True)
      email = models.CharField(max_length=225)
      #password = models.CharField(max_length=120)
      external = models.IntegerField(null=True, blank=True)
      deleted = models.IntegerField(null=True, blank=True)
      purged = models.IntegerField(null=True, blank=True)
      form_values_id = models.IntegerField(null=True, blank=True)
      disk_usage = models.DecimalField(null=True, max_digits=16, decimal_places=0, blank=True)
      objects = UserManager()
      USERNAME_FIELD = 'email'
      class Meta:
          db_table = u'galaxy_user'
  </code></pre>
  
  <p>I have a custom authentication:</p>
  
  <pre><code>class AuthBackend:
  
  def authenticate(self, username=None, password=None):
      if '@' in username:
          kwargs = {'email': username}
      else:
          kwargs = {'username': username}
      try:
          user = User.objects.get(**kwargs)
          if user.check_password(password):
              return user
      except User.DoesNotExist:
          return None
  
  def get_user(self, user_id):
      try:
          return User.objects.get(pk=user_id)
      except User.DoesNotExist:
          return None
  </code></pre>
  
  <p>Even after entering the correct username and password check_password() always returning false so that I can't login. I tried that in terminal too:</p>
  
  <pre><code>user.check_password(password)
  </code></pre>
  
  <p>is always returning <code>False.</code> </p>
  
  <pre><code>#views.py:
  
  def login_backend(request):
      if request.method == 'POST':
          username = request.POST['username']
          password = request.POST['password']
          user = authenticate(username=username, password=password)
          state = "Username or Password Incorrect!"
          if user is not None:
              login(request, user)
              return HttpResponseRedirect('/overview/')
          else:
              return render_to_response('login_backend.html', {'state':state}, context_instance=RequestContext(request))
      else:
          return render_to_response('login_backend.html', context_instance=RequestContext(request))
  </code></pre>