[Django]-AttributeError: 'User' object has no attribute 'check_password' error in Django?

6👍

As described in the custom user documentation, your User model must inherit from django.contrib.auth.models.AbstractBaseUser, which adds all the relevant methods.

0👍

In the documentation for Django 1.5 (which is the first one with AUTH_USER_MODEL) shows the method the alternative User model must have, and one of them is check_password. So, IMO, you have two ways for solving your issue.

  1. Substitute the User model properly providing all required methods.
  2. Forget about substituting the User model and just write a custom AUTH BACKEND without including “AUTH_USER_MODEL”
👤esauro

0👍

Get the Django 1.5 RC. And follow these instructions on writing a custom User class.

👤dmg

0👍

Add from django.contrib.auth.hashers import check_password after get_user_model

Leave a comment