Django: How to customise user model and create one to one user-profile relationship ?

  Рет қаралды 892

Jitendra Kasaudhan

Jitendra Kasaudhan

Күн бұрын

Пікірлер: 4
@codedjango
@codedjango 4 жыл бұрын
@9:38 you deleted the db.sqlite3 file so how will that user jk1@gmail.com exist? It has to be created again
@jitendrakasaudhan
@jitendrakasaudhan 4 жыл бұрын
you are right @CodeDjango :) thanks for pointing that out. I realized that @10:35 and recreated new user again :) :)
@abhinavnarang7855
@abhinavnarang7855 4 жыл бұрын
bro why you haven’t used AbstarctBaseUser here as we are changing the way how django authenticates with email instead of default username???
@jitendrakasaudhan
@jitendrakasaudhan 4 жыл бұрын
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 ...
Django REST framework: Concept behind different types of serializers?
55:40
Extend Your Django User Framework With a One To One Field
11:39
Pretty Printed
Рет қаралды 42 М.
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
Django api: How to create CRUD API using PURE django ?(without REST framework)
20:51
Cross-Site Request Forgery (CSRF) Explained
14:11
PwnFunction
Рет қаралды 475 М.
Customize User Profile Model - Django Blog #27
10:31
Codemy.com
Рет қаралды 59 М.
This Neovim "Plugin" Replaces 40 Others
15:46
DevOps Toolbox
Рет қаралды 24 М.