@9:38 you deleted the db.sqlite3 file so how will that user jk1@gmail.com exist? It has to be created again
@jitendrakasaudhan4 жыл бұрын
you are right @CodeDjango :) thanks for pointing that out. I realized that @10:35 and recreated new user again :) :)
@abhinavnarang78554 жыл бұрын
bro why you haven’t used AbstarctBaseUser here as we are changing the way how django authenticates with email instead of default username???
@jitendrakasaudhan4 жыл бұрын
Hi @Abhinav , good catch :) :) Actually in our case we want to have all the fields of User model provided by django eg. email, is_active, first_name, last_name...etc and just change username functionality with email therefore AbstractUser is good to use as it contains all the necessary fields but in case of AbstractBaseUser we have to provide all these fields ourself :) :) If you try to check the code of AbstractUser class github.com/django/django/blob/master/django/contrib/auth/models.py#L321 you will see that all the fields are there and it also inherits from AbstractBaseUser class.... but in case of AbstractBaseUser class you will not find all the fields github.com/django/django/blob/master/django/contrib/auth/base_user.py#L48 ...