

Inactive, this method will always return False. Returns True if the user has the specified permission, where permĭocumentation on permissions). If obj is passed in, only returns the permissions for this Returns a set of permission strings that the user has, both through If obj is passed in, only returns the group permissions for Returns a set of permission strings that the user has, through their If obj is passed in, only returns the user permissions for this Returns a set of permission strings that the user has directly. has_usable_password() ¶īeen called for this user. You may need this if authentication for your application takes placeĪgainst an existing external source such as an LDAP directory. Marks the user as having no password set. (This takes care of the password hashing in making the Returns True if the given raw string is the correct password for When the raw_password is None, the password will be set to an Sets the user’s password to the given raw string, taking care of the Swapped out, you should use this method instead of referencing the Is set to theĬurrent date/time by default when the account is created. date_joined ¶Ī datetime designating when the account was created. Designates that this user has all permissions withoutĪ datetime of the user’s last login. Be aware that the permission-checking methods such asĪuthentication in the Django admin all return False for inactiveīoolean.

If you want to allow inactive users to login. This doesn’t necessarily control whether or not the user can log in.Īuthentication backends aren’t required to check for the is_active We recommend that you set this flag to False instead ofĭeleting accounts that way, if your applications have any foreign keys Designates whether this user account should be consideredĪctive. Designates whether this user can access the admin site. Many-to-many relationship to Permission is_staff ¶īoolean. Many-to-many relationship to Group user_permissions ¶

Store the raw password.) Raw passwords can be arbitrarily long and canĬontain any character. A hash of, and metadata about, the password. Max_length=191 because MySQL can only create unique indexes withġ91 characters in that case by default. If you use MySQL with the utf8mb4Įncoding (recommended for proper Unicode support), specify at most If you needĪ longer length, please use a custom user model. The max_length should be sufficient for many use cases.
