filmov
tv
Django Custom User Model | Email as Username | Phone as Username | Authentication Example |Code Band
Показать описание
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:
Subscribe | Code Band
Other videos in Code Band:
:) You Can Find Me On:
Комментарии