Customize User Profile Model - Django Blog #27
ฝัง
- เผยแพร่เมื่อ 12 ก.ย. 2024
- In this video we'll start to customize our User model to add more fields by creating a new Profile model and associating it with our User model.
It's hard to add things to the User model, instead we can extend it by creating a new model and giving it a OneToOne association with the User model.
That's what we'll do in this video to add a bio to our User Profile.
▶️ Watch Entire Django Blog Playlist ✅ Subscribe To My TH-cam Channel:
bit.ly/3bWN6wj bit.ly/2IGzvOR
▶️ See More At: ✅ Join My Facebook Group:
Codemy.com bit.ly/2GFmOBz
▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN
Best tutorial on python, django and the mentor also....i have learned a lot from you.
More subscribers and likes are appreciated for him..
Wow thanks!
What an awesome explaination. Deserve more views for sure.
This is great just starting in django for about a week and wanted to overload a the basic authentication user model. this was the perfect speed for beginners as long as you have your files open in tabs in your IDE and your webpage already in browser.
i always come to you when ever my site has bugs, you are awesome dude
awesome
it was amazing thank you sir
Most welcome
Great video as usual. My question however I, what if I have multiple user groups and I want to provide specific fields in which each group can enter related information based on their roles in an organisation or setup
Thanks for making this video. Very clear explanation. I'm trying to make a simple user profile to add a URL for an avatar to implement later with a Vue component.
Hello!
Great video as always 😁🥰
But i have a question.
How am i going to create the Profile model right after i created a user in django?
That still doesn't answer the main question: How does a user create and edit a profile?
You've done all this through the admin page, but we didn't get to see how you set it up so the user does it himself.
That may be your main question, it's not the main question of this video. I have plenty of videos on that sort of thing on the channel.
Greate tutorial, this works. However I think it we should create a separate app dedicated to users and put in a custom user model just to keep things a little entangled or unbundled for ease of scaling and updating.
Whatever floats your boat
Epic Video.
Thanks
Bro u r king . u don't know how u helps me
Happy to hear it!
hello, great video I'm learning a lot with you. Can I customize the width of a CharField or ArrayField for example? And how?
Hi, First of all thanks for the tutorials. I have learned so much from them. Can you please make tutorials on Pygame? Please do it. Thanks, Love from Bahrain 🇧🇭 ❤️
Yeah I'll be doing pygame soon...
This guy is awesome ..
Thanks!
Thanks!
Welcome!
thank you
Welcome!
Great as always. I am wondering how we can add a date column in admin / profile page so we know as admin when that profile was created. Appreciate if anyone can solve this for me thanks
Nice
Thanks
How can I make using e-mail field instead of user field??
Sorry, I don't discuss that in this playlist.
how do we view somone else profile
👍
👍
I found that I had to do the following in models.py for the migration to work properly : bio = models.TextField(null=True)
yeah
how to make logout functionality
I have videos on that all over the channel
Sir , how to use Mail id or Mobile Number in place of Username for Authentication
Too complicated to explain in a comment
@@Codemycom Can you please make a video in this sir .
@@Codemycom that is my question also...it would be great to make another video based on it ...thanks in advance
hi
@@rahamanhabib1347 hi
class LoginViewSet(ViewSet):
def create(self, request):
try:
user = authenticate(request, username=request.POST.get('username'), password=request.POST.get('password'))
if user:
token, created = Token.objects.get_or_create(user_id=user.id)
return Response({'message':['welcome',request.POST.get('username')],'your login token is':token.key},200)
return Response({'message':'invalid credentials'},401)
except Exception as e:
return Response({'data': '', 'message': str(e)}, 500)
i have made loginapi view using viewset now i want to add user profile view in it can you please tell me how to do that
How to Create and browser profile
keep watching the playlist
if i change our profile model's name as Profilex , i made all the changes , it didnt work, why ? Must be Profile ?
You have some type somewhere