I am following django's doc on creating a custom user model and I am confused in defining the create_user()
and create_superuser()
. When defining create_user()
the password arg passed is None
def create_user(self, email, date_of_birth, password=None):
# create user here
...
While creating create_superuser()
the password is provided by the caller.
def create_user(self, email, date_of_birth, password=None):
# create user here
...
How does django knows what the password in create_user()
function? I am sorry if this is a noob question but I really need to understand. Could you please help me understand the concept here. Thank you.