Extending User model using One-To-One Relationship - Django

  Рет қаралды 15,980

StudyGyaan

StudyGyaan

Күн бұрын

In this tutorial, I will show you different strategies you can use to extend the Django User Model. In One-To-One link, the Django model is going to have its own database table and will hold a One-To-One relationship with the existing User Model through a OneToOneField
Complete Tutorial for BUILD DJANGO CRM FROM SCRATCH - • Django CRM Project
Tutorial & Code - studygyaan.com/django/how-to-...
Full Project on GitHub - github.com/studygyaan/Django-...
Code till this video - github.com/studygyaan/Django-...
Topic Covered - django tutorial,django crm part 5,extend user model django,extend user profile django,extending user model using a one-to-one link django,one to one field django,django user model extend,django user model one to one,django custom user model authentication,django extend user model one to one,django model one to one,django user one to one,django model one to one relationship,django model one to one field,django model one to one relation,django model one to many
#DjangoTutorial #DjangoCRM #Django

Пікірлер: 22
@StudyGyaan
@StudyGyaan 3 жыл бұрын
Django CRM Playlist - kzbin.info/aero/PLSPMgrv4IuJ4WLURdlzKNx4sgsyqW8d5q Django Tips Playlist - kzbin.info/aero/PLSPMgrv4IuJ6jm66M2rSZM_qIakywFoIr Django Rest Framework Playlist - kzbin.info/aero/PLSPMgrv4IuJ4tPeMgDGx7XV-4VRrjzZ8t Django Oscar Shopping Website Playlist - kzbin.info/aero/PLSPMgrv4IuJ5tX9Sk7hjNrHsQRC3ppRtG
@drdinislam5321
@drdinislam5321 Жыл бұрын
So wonderful bro
@90daner
@90daner 3 жыл бұрын
really thanks sir! i learing a lot!
@gabrielturrillas
@gabrielturrillas 3 жыл бұрын
If i have a custom user model i have to create a field for the user model to hold the relationship? i have han error: instance.profile.save() AttributeError: 'UserAccount' object has no attribute 'profile' ty for your time
@gabrielturrillas
@gabrielturrillas 3 жыл бұрын
the video misses the related_name in the one to one field but other than that great video ty very much
@awantichavan8353
@awantichavan8353 3 жыл бұрын
Hello sir.. watched Ur playlist and got the contents I was searching for.. Really you did a great job making these videos which are very much useful...but I had a doubt on the admin page we can see the "Django administration " I wanted to ask is can we change the name Django administration to some other name and if we can then can you please tell how it is possible..plzz do reply..
@izzati1262
@izzati1262 3 жыл бұрын
hi there, i seem to get the error: OperationalError at /admin/login/ no such table: userprofile_profile after trying to login using superuser. what could have been wrong?
@StudyGyaan
@StudyGyaan 4 жыл бұрын
Do you like this video??? Comment and tell me..... Complete Tutorial for BUILD DJANGO CRM FROM SCRATCH - kzbin.info/aero/PLSPMgrv4IuJ4WLURdlzKNx4sgsyqW8d5q
@gabrielturrillas
@gabrielturrillas 3 жыл бұрын
great!
@punpompur
@punpompur 2 жыл бұрын
I had logged out of the admin console before creating userprofile inside apps folder. After I created userprofile and wrote the snipper inside model.py that you showed in the video, I tried to login to the admin console but got the error "Related object does not exist". I removed apps.userprofile from LOCAL_APPS in settings.py, restarted the server and launched admin console. This time I was able to login without any error. Now I added apps.userprofile to LOCAL_APPS again, but this time I did not log out from admin console like I did earlier. I refreshed the page and was able to see the userprofile table inside the admin console this time. I did not understand this issue. If I am not logged in to the admin console, and after setting up userprofile inside the apps folder, I launch the server and go to admin console, why won't it let me log in with admin credentials and give "Related object does not exist" error?
@BKFirst
@BKFirst Жыл бұрын
Can I do this If I am using AbstractUser?
@puterich
@puterich 2 жыл бұрын
why have two methods? Couldn't the save method be called before the create method? and why save the user and not the profile?
@pensameufilho
@pensameufilho Жыл бұрын
Just added "instance.profile.save()" to the first @received and worked fine. Looks like you don't need 2 signals.
@semih2211
@semih2211 4 жыл бұрын
after created user, I cannot see profile right away.
@jesusj.navarro9276
@jesusj.navarro9276 4 жыл бұрын
Hello friend, your videos have been very helpful to me. I have a problem with a code when creating a model, can you help me?
@StudyGyaan
@StudyGyaan 4 жыл бұрын
Ok
@jesusj.navarro9276
@jesusj.navarro9276 4 жыл бұрын
Professional Cipher I create a class called "Product" and its attributes (name, quantity, price) can I make my attribute (quantity) be added to another class?
@tomaszbonarkiewicz6368
@tomaszbonarkiewicz6368 3 жыл бұрын
Hello, really great video, I have just used it to create extended user by myself. I have one question. How to use it with drf and serialization? I want to send POST request to create new user and fill the Profile: { "username": "test", "email": "aa@aa.com", "password": "test123", "password1": "test123", "profile": { "user": "test", "profile_field": "123", } } Still have some errors like - "profile": { "user": [ "Incorrect type. Expected pk value, received str." ] } Do you know how to send user with profile by using one post request?
@harshsaraiya4509
@harshsaraiya4509 Жыл бұрын
hey. did you find the solution to this?
@AnishKumar-gh7yh
@AnishKumar-gh7yh 3 жыл бұрын
How i can contact you its important
@StudyGyaan
@StudyGyaan 3 жыл бұрын
professionalcipher@gmail.com
@nishantsoni5801
@nishantsoni5801 3 жыл бұрын
USE THIS IN YOUR PROFILE MODULE: def __str__(self): return f'{self.user.username} Profile' this code save profile with the name of user profile example : object profile(1) saves with admin profile
The gist of the the custom user model in Django
10:17
Django road
Рет қаралды 6 М.
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 8 МЛН
Хотите поиграть в такую?😄
00:16
МЯТНАЯ ФАНТА
Рет қаралды 3,5 МЛН
Double Stacked Pizza @Lionfield @ChefRush
00:33
albert_cancook
Рет қаралды 51 МЛН
Python Django - How to add custom fields to the User Model ?
26:10
JimShapedCoding
Рет қаралды 22 М.
How to Create Sign Up Registration View in Django
10:15
StudyGyaan
Рет қаралды 11 М.
Django Authentication Basics
19:38
Pretty Printed
Рет қаралды 109 М.
Custom User Model | Explore Django
14:01
Code With Stein
Рет қаралды 34 М.
Custom Django User Model // DJANGO Tutorial
1:04:40
CodingEntrepreneurs
Рет қаралды 155 М.
Adding a session timeout in Django
15:44
Cloud With Django
Рет қаралды 8 М.
Django Project - Code a CRM App Tutorial
2:23:40
freeCodeCamp.org
Рет қаралды 409 М.
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 8 МЛН