class models.CustomUserManager
-
create_user(*username_field*, password=None, **other_fields) -
The prototype of
create_user()should accept the username field, plus all required fields as arguments. For example, if your user model usesemailas the username field, and hasdate_of_birthas a required field, thencreate_usershould be defined as:def create_user(self, email, date_of_birth, password=None): # create user here ...
-
create_superuser(*username_field*, password, **other_fields) -
The prototype of
create_superuser()should accept the username field, plus all required fields as arguments. For example, if your user model usesemailas the username field, and hasdate_of_birthas a required field, thencreate_superusershould be defined as:def create_superuser(self, email, date_of_birth, password): # create superuser here ...Unlike
create_user(),create_superuser()must require the caller to provide a password.
BaseUserManager provides the following utility methods:
Please login to continue.