auth.models.UserManager

class models.UserManager The User model has a custom manager that has the following helper methods (in addition to the methods provided by BaseUserManager): create_user(username, email=None, password=None, **extra_fields) Creates, saves and returns a User. The username and password are set as given. The domain portion of email is automatically converted to lowercase, and the returned User object will have is_active set to True. If no password is provided, set_unusable_password() will be c

auth.models.User.user_permissions

user_permissions Many-to-many relationship to Permission

auth.models.User.username_validator

username_validator New in Django 1.10. Points to a validator instance used to validate usernames. Defaults to validators.UnicodeUsernameValidator on Python 3 and validators.ASCIIUsernameValidator on Python 2. To change the default username validator, you can subclass the User model and set this attribute to a different validator instance. For example, to use ASCII usernames on Python 3: from django.contrib.auth.models import User from django.contrib.auth.validators import ASCIIUsernameVali

auth.models.User.username

username Required. 150 characters or fewer. Usernames may contain alphanumeric, _, @, +, . and - characters. The max_length should be sufficient for many use cases. If you need a longer length, please use a custom user model. If you use MySQL with the utf8mb4 encoding (recommended for proper Unicode support), specify at most max_length=191 because MySQL can only create unique indexes with 191 characters in that case by default. Usernames and Unicode Django originally accepted only ASCII let

auth.models.User.set_unusable_password()

set_unusable_password() Marks the user as having no password set. This isn’t the same as having a blank string for a password. check_password() for this user will never return True. Doesn’t save the User object. You may need this if authentication for your application takes place against an existing external source such as an LDAP directory.

auth.models.User.set_password()

set_password(raw_password) Sets the user’s password to the given raw string, taking care of the password hashing. Doesn’t save the User object. When the raw_password is None, the password will be set to an unusable password, as if set_unusable_password() were used.

auth.models.User.password

password Required. A hash of, and metadata about, the password. (Django doesn’t store the raw password.) Raw passwords can be arbitrarily long and can contain any character. See the password documentation.

auth.models.User.last_name

last_name Optional. 30 characters or fewer.

auth.models.User.last_login

last_login A datetime of the user’s last login.

auth.models.User.is_superuser

is_superuser Boolean. Designates that this user has all permissions without explicitly assigning them.