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
usernameandpasswordare set as given. The domain portion ofemailis automatically converted to lowercase, and the returnedUserobject will haveis_activeset toTrue.If no password is provided,
set_unusable_password()will be called.The
extra_fieldskeyword arguments are passed through to theUser’s__init__method to allow setting arbitrary fields on a custom User model.See Creating users for example usage.
-
create_superuser(username, email, password, **extra_fields) -
Same as
create_user(), but setsis_staffandis_superusertoTrue.
Please login to continue.