Django Custom User Model | Email as Username | Phone as Username | Authentication Example |Code Band

preview_player
Показать описание
In this video, I'm gonna be talking about making a custom user model in Django. We will show you email authentication as well as phone authentication in Django. We will first make a custom user model that inherits from abstract user (or abstractbaseuser) and add a new email field which is unique (or phone number field which is also unique). We will then set the username field to be email (or phone) and also we will set the required fields to be empty. Then we will make our own custom model manager and implement our own _create_user, create_user and create_superuser methods which are email based (or phone based). We will then create a new superuser and then refactor the admin template to adapt to the new email based authentication.(or phone number based authentication). We will then make registration and login views and urls which are also email based (or phone based). For the registration view, we will build our own custom form which inherits from the built in user creation form.

Subscribe | Code Band

Other videos in Code Band:

:) You Can Find Me On:
Рекомендации по теме
Комментарии
Автор

This was the only video due to which I understood abstract user model, thanks a lot bro !!

nishantpacharne
Автор

Sir it's really really helpful video for me I been struggling from last couple of weeks to create custom login model and after watching alots of video still not understanding but after that video I totally understand how it's worked ❤️

prashantnigam
Автор

Must watch the video for getting practical implementation Django.Helped a Lot. Thanks a lot.

an_uncommon_sense
Автор

This is the best help I've seen on this issue. It would have love it more if a custom login authentication form was used.

paborlouise
Автор

u really earned a subscriber, so detailed and code is made available, thanks a lot bhai

ThisAmit
Автор

You are the best. Your video was so timely. Thanks

michaelamoo
Автор

This was detailed video with all properly written source code Thank you @codeband

smitrami
Автор

Wow..thanks for this....life saved today

bellosegun
Автор

Thank you very much. This solves my problems

oluwagbengakosoko
Автор

i added phone number field in my Customuser, but i didnt overwrite default filds, now i want something like if user will forget the password than i want to verify them using phone number insted of default authentication email, because i didnt asked for email to user in my site, can you help me ?

techm
Автор

Hi, Ive got a question, how can i make a form for updating this custom user, the form should inherit from UserChangeForm or from forms.ModelForm? Im making this question because Im struggling with it, , even though the form is rendered, when I click submit, nothing happens

arturomtz
Автор

i m facing with this issue. please how i can solve it. Code Band
i want to create super user with phone_number remaining things is OK. and i can't use username but it again give me error.
when i put
phone_number :
email :
but when i enter password first time and than when i hit enter then the below issue occur. and also
when i putting password it displaying(not like password field hidden).

null value in column "username" violates not-null constraint

faheemullah
Автор

Thank you, this has been helpful.
I am working on a campus voting system, which would be using student's registration number as the unique identifier... but I have been trying to do that, to no avail. I would like the admin to have their normal login processes, and the voters to use the registration number, and still be referenced as users, but it has become challenging... would you please help?

techwithdenzel
Автор

please upload the all class based views also your videos are nice to understand thanks for this videos

vijaykumar-tvoo
Автор

Hello brother, i want to login with mobile or email both. can you suggest me and also, how to pass monbile no on create super user

praveenpatel
Автор

Thank you. The default username is not changing to email even after doing the template priority.

lewismuttwiri
Автор

if i had two types of users like customer and store and need different info from each one how can I handle it

Mohamedreda-nxfu
Автор

In my project, there is problem in foreign key

pankajmali
Автор

I extended User model in customer, everything is stored in database perfectly but when I checked "request.id" in view.py it always returns 1 after logging

pankajmali
Автор

Where is models/authentication file here

Sharmagulshan