Custom User Model with email login (DJANGO)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we are going to continue with our django project and more specifically we're going to start building our custom user model now before we start i want to give you a little bit of information about uh how i've been building the course and how i'm going to be building it out moving forward now i realized in the last video that writing out this html is just going to take way too long and basically i hate doing it so i don't want to do it anymore the last video was basically torture for me to sit there and film and write all that tedious html out also the editing was basically torture i would i would definitely compare that to torture and many of you probably don't care about that html anyway you're probably perfectly fine with me just copy pasting in the html and maybe quickly running through it and talking about it this this was originally supposed to be like a beginner uh course that would build up to like a much more advanced javascript html websockets all that kind of stuff but now you know i just really don't want to write this html there's just so much and it's so boring it's very much like torture i'm going to say it again so anyway moving forward what i'm going to do is i'm going to be writing out the javascript all on video or that that's the plan anyway because the javascript can be quite complicated when we started working with websockets but from here on out i think i'm going to just copy paste in html copy paste in css if you don't like it too bad go and learn a little bit about html and css that's not what i'm going to be teaching in this course let's get into the video so the way django works regarding user models is it comes with like a user model out of the box with some really basic properties you know you got like your email username password obviously are they an admin are they staff a bunch of kind of built-in properties what we want to do is we want to extend that user model and customize it to add some extra properties and also instead of using the username to log in which is the django default we want to use the email to log in so let's get started customizing that user model okay so the first thing that we are going to do is i'm going to stop my development server notice that i'm still running my virtual environment i'm going to write python manage.py start app and this this app is going to be called account and i'm going to press enter and of course now this is going to generate a new folder in here so now that we have a new app the first thing we always need to do when we create a new app is go into settings.py and yes i've adjusted the font so this should hopefully look a little bit better for you guys much easier to see go into the installed apps i'm going to copy this line and add account here now pressing ctrl s on that and i'm going to go into models.py and we are going to build our custom account model so this is generally the account model that i use for almost all of my projects i like to use you know i always like to use the email to log in as opposed to the username and then i have some other basic properties that i add so first we actually need an import we need to import the abstract base user so from django.contrib.off.models import the abstract base user and you could search this on github if you wanted to go look at the django source code and take a look at the abstract base user class you could do that but i'm just going to kind of use it here and you can follow along or you can go and explore it more yourself it's up to you the base user manager is something that we're going to use to build a custom manager which you're going to see in just a second also so inside of account here i want to reference our abstract base user which is essentially going to extend the base user class for django now i want to define some fields the first field is going to be an email field and you're probably wondering why i i did this kind of all these tabs here so i actually did one space and then a whole bunch of tabs i do this because the the models when we define the fields they line up better and the code just looks cleaner so you can do this or you can do this it really doesn't matter this is just something that i do to keep things looking a little nicer so now i'm going to do models dot email field so email field and this has a couple parameters the verbose name is going to equal email this just gives more information inside of the admin to kind of identify what this field is going to do i want to set a max length equal to 60 characters i don't want any emails longer than 60 characters and then this is very important we want to set unique equal to true that means that nobody can share the same email that is very very important now we want to do the username field so equals models dots this is just going to be a character field again we'll have max length we want to have maybe a username with a max length of 30 characters and again very important unique equals to true on that one also now i want date joined so this would be like the date that they very first joined our website this is going to be a date time field the verbose name on this one is going to be date space joined and i want to do auto now auto now true and set that equal to true so auto now true will basically set the set the date set that flag as soon as the object is created so as soon as an account object is created this will get set so that's how we we know when they join because that's going to be when their account model actually gets built now i'm going to copy this line one more time and instead of date joined i'm going to do last login and do a tab to line this up and change this text just to say the last login and this one's not going to be auto now true this is just going to be auto now so every time they log in this date will get set basically what will happen is every time this account object is altered or accessed this this date will get overwritten that's what auto now means now we're going to have a couple boolean fields the first one is going to be is admin so models.booleanfield and the default value on this is of course going to be false we don't want a bunch of people having admin access that are not admin then the next one is going to be is active and the last one is going to be is is staff actually there is going to be one more we need four we need admin active staff and is super user those are the four boolean fields that we need one of these however does have a default value of true now you're probably wondering why i included all of these are these all really necessary well they're actually included into the abstract base user class so we need to override these in order to use this model to extend our user model these are basic these are basically like required fields so we have to add them now is admin is an obvious one that's useful is super user that's probably a useful one but is staff and is active those aren't necessarily useful we just have to include those so that's why they're here now i'm going to create a profile image field so profile image equals models dot image field and we're going to need a third party package in order to create this image field which we're going to add in just just a minute here now max length equals 255 characters and i want to set an upload to field which i'm not going to set yet just going to leave that blank i want to do null equal to true blank equal to true so meaning that this this this profile image can be known it can be blank it doesn't have to actually have something and now i want to set a default which i will also leave blank for now so there's a couple things we got to do number one is we got to get the package that supports an image field number two is we need to set a pathway that the images are going to be uploaded to or stored at and then we need to set a default so what's going to be the default image you know right when the user creates their account obviously they're not going to have a custom profile image yet so we need to set a default pathway so first things first what about this image field well this image field is actually part of a package a package known as pillow so i'm going to do pip install pillow and that should allow us to use an image field looks like the requirement is already satisfied for me since obviously i've already built this project but that shouldn't be the case for you and of course since we've installed a new package i want to do pip freeze requirements.txt just to keep track of all the requirements for the project always important to do that so now we have an image field now what about the upload to and the default file paths so i'm going to write these actually above our account class i'm going to create two kind of functions that are responsible for outputting those those pathways find get profile image file path and this will take self and file name and i'm going to return profile underscore images slash and i want to do plus actually we can use since we're using python 3 we can use this new um string i can't remember the word i just had a i'm having a brain failure it's called string interpolation or something like that i can't remember but anyway what you do is you just put an f at the front and then basically like with kotlin or any of the modern programming languages you can do squiggly braces and then put whatever you want inside of here so in this case i want to do self.primary key because we're going to be referencing the account model so the folder structure is going to be profile images the user's pro the user's unique primary key and then i want to do the the name of that image which is they're all going to have the same name it's going to be profile underscore image dot png and we need to surround this in in quotations because this is a string this is just a raw string this will also be a string this we might need to do string self dot primary key i'm not 100 sure about that i'm going to leave it as self.primary key just to see what happens but uh yeah we'll see if that's okay so these profile images are going to be saved in media cdn and then it's going to be a folder named profile images which will be generated and then it'll be separated by the primary key of the user and the name of that image will be profile underscoreimage.png now what about the default pathway so let's create that so get default profile image and that doesn't take anything and we're going to return the pathway to the default profile image so in this case it's going to be the coding with mitch just the coding with mitch folder and then logo you can do the 1081 if you want that's the one that i'm going to use so 1080 1080. png so it's going to look into our static cdn it's going to see the coding with mitch folder and it's going to grab the logo right here this image right here that's what this is pointing to so upload two i can just get the get profile file path get that one in there and then go over to the right and we wanna get the default profile image path right here so the upload two is the profile image file path then the default is that default profile image now the last field that we're going to add here is hide email so hide underscore email if you recall from the demos for this project there's an option inside of the account properties of each user to hide their email from other users so it's just going to be a boolean field boolean field and the defaults here will be true so by default all users will be hiding their email to from other users now we need to add a couple more parameters here the first one or the actually the next two are very very important if you want to log in with the email as opposed to the username django by default will log in with the username the user like if you just have a username but if you want to use email you have to set this parameter username field set to email so this matches this if this was something else if i had this as like a user email i would have to have this as user email but this is email so i have it matching as email now we need to set the required fields so required fields and set that equal to username so the new username field quotation marks is the email field but another required field is the username so both of these are required to create an account now the next thing that's required when you build a custom django model is a like a two string method or a string method so this will return this is like when you access the object what is going to be returned if you don't access any of the individual fields it's like a default return value if you don't access an individual field i like to return the username here because some people like to hide their email so their username is kind of like the public thing that you can be safe with sharing so i like to return the username now i'm going to add a couple more things that are required for this account model since we're using the abstract base user so if you recall from up here when i was talking about the is admin is active as staff a super user now we want to set kind of some default permissions that are with the abstract base user class the first permission is has perm so that's an override function that's a function that i'm going to be overriding so i want to take self the permission object equals none so by default object equals none and then just do return self dot is admin so it's kind of just a default function saying does the user have permission to do some like administ thing if they are an admin then yes it's just kind of a simple rule nothing fancy nothing complicated second one is going to be has module permissions this is another one that has to be overridden so has module perms self and then app label and to keep this simple i'm just going to say return true doesn't really matter in this case you know we can just say everybody sure so this is the basic structure of when you want to build a custom user model you extend the abstract base user class you include whatever field you want to log in with in this case it's the email set it to unique is true set the new username field for the thing that you want to log in with set any other required fields you have to override these functions and make sure to override these parameters here these four booleans and that should be it the other fields you can just kind of add you can add infinite number of other fields to like a custom user now i'm gonna build one more function that's going to add a little bit of convenience later on right now it's not going to make any sense we're not going to use this until later in the course but i just want to build it now so get profile image file name what this is going to do is later when we actually save a profile image remember we want to save every profile image with the name profile underscore image.png so if a user uploads a profile image that has you know some other name say it's just like some random string we want to be able to extract that and then replace it with profile image so that's that's what this is going to help us do i want to get the file name so that later it's going to be easier to extract it and replace it with kind of that generic so i'm going to do return string self.profile image and then inside of here i want to do i want to select like an index so string self.profile image this is how you select an index with python you do square braces on the string itself and i want to select on an index so dot index so i'm looking for a specific index profile image slash or profile images so what i'm looking for is i'm looking for this string right here inside of the pathway and then i could use string interpolation here also add the squiggly braces do self dot primary key and then another slash oh and then we got to finish with a a colon so this is how you select like a sub string using python use square braces and then you use an index and then you if you wanted to select like a substring with between two indexes like i'll just take this out it would be like index one would be here and then index two would be here that is how whoops it would be like sorry it would be like index one is here and index two is here but we want to just select an index and then everything until the end so that is what i'm doing here i'm finding an index and then saying take take everything towards the end okay so there's our custom user model now i'm going to build a custom user model manager now managers model managers in django and python can be used to build kind of queries that commonly get used or override functions that commonly get used two functions that commonly get used for us are going to be creating a user so like one would be create a new user and then the second one would be like create a super user so that would be like me creating a super user so those are the two functions that we want to override for the kind of account creation process so i'm going to create a custom account manager so my account manager is what i'll call it and it's going to use base user manager so it's this class that we imported up here now i want to override the functions so the two functions that i'm interested in are create user so self now the parameters that we're interested in are email username and password and the default will be none and then i do want to do if not email so just kind of a little bit of error handling here i want to raise an error raise a value error and i can just say you know users must have an email address because that's a required field so if there's no email that's what i want to say now i'm going to copy this and do the same thing for the username because remember the username is the other required field users must have a username username there we go and i'll add a period there in a period there and if those two conditions are met then i can create that user so user user equals self.model and i can set the email equal to self.normalize email normalize email so that's going to make it lower case we don't want any any kind of case sensitivity when it comes to creating an account or something that a login parameter that you're going to use because if somebody accidentally uses like a capital letter when they sign up we we don't want that to be an issue when they go to login so using normalized email is very important and also later we're going to build we're going to build a custom model back end to make sure that when they log in everything gets casted to lower case so that if they do accidentally enter a capital it's going to get casted to lower case and there's not going to be an issue all right so email and then username equals equals the username that is passed at the top we don't need to normalize that that doesn't matter since they're not going to be logging in with the username so it's not important to normalize it now go to the next part i want to set the password so user dot set password and set that equal to the password and then user dot save and do using using equals self dot underscore db and then return that user so basically just overrided the create user function so that it'll show like some custom errors that i've defined making sure to normalize the email setting the password and then saving it now the next one as i said is creating a super user so define create super super user and i want to do self email username and password and i want to do user equal self.create user so i'm using that create user function that i literally just overrided right up here and the parameters for this one is going to be email actually it's going to be kind of the same so let me just copy these we have email we want to normalize the email we have the username and we have the password equals password i could have actually also included the password up here that would have been fine but i called set password so two kind of just different ways to do the same thing now i want to do user dot is admin and set that equal to true because remember we're creating a super user and i'm going to copy this two more times and do is staff set that to true because if you're an admin if you're a super user you're basically everything so i want to set all of these booleans to true so super user set that equal to true also and then do the same thing with this i want to save it and then return that user now last but not least we need to set this custom user manager to our our model so i can do objects and set it equal to my account manager so that's how you kind of tie the account to the custom manager that was built up here okay so let's uh let's save this i'm pressing ctrl s and i'm going to open up a command prompt and we are going to do python manage.py make migrations so this builds kind of the the database transactions that are going to need to be committed to make all these changes because this is going to be a a table that gets built in our database so by doing make migrations it should um looks like we actually got an error auto now true let's go take a look at that oh this needs to be auto now add my bad so auto now add equals true let's go back to the command prompt and try that again so python manage.py make migrations uh looks like oh i didn't save it pressing ctrl s now trying that again there we go so it created the model created the migrations if we look into our account section here it has generated our migrations file this is defining what needs to be to our database in you know django language so now let's go back to the command prompt and do one more command python manage.py migrate so this is actually going to apply the migrations to our database so like if i was to open postgres right now now i would see that this this new account table has been generated yeah since we're going to need to do that later anyway why don't i why don't i just do that and show you right now so psql post postgres postgres or you could log in with the user django to the specific database so coding with mitch chatdev and logging with django either one or you could just use the postgres user which has all the permission i typed the wrong password the password is actually password there we go now i want to i'm already connected to the database so now i want to list the database table so backslash dt and boom there we go there's our account table that has been generated now because we have created this new custom user model and before before i created this model like earlier in the course when we were setting things up i i created a super user so if i was to run the server i'll show you so python manage dot py run server and if i was to go to the admin let me just go to the admin now remember i already have a user so if i go to users here i have this this kind of default user that was created before we built our user model but since we now have a different custom user model i want to i want to delete like basically all the users that we have because we've changed the way that this is being built a super user is being built differently basic users are being built differently so it's a good idea to just clear out the database and then recreate that super user so what i'm going to do is i'm going to press backslash q to quit and i'm going to log in with the postgres user which is kind of like the top the the user with the highest privileges on our database and that should be the same for you so now i've logged in now i'm going to do i'm going to drop database i'm going to delete the database so drop database coding with mitch chatdev and do a semicolon so that's going to delete it all my data is now going to be cleared looks like it's giving me an error that's because the server is running it's telling me that something is another client is currently using it so if i stop the server by pressing ctrl c and i run that again that should now delete the database perfect so now i want to create the database again so i'm going to go create database coding with mitch chat dev uh now i want to give privileges to the user django to use that database so grant all priv le i always forget i'd spell this priv priviled jazz it's a weird privileges on database coding with mitch chatdev to the user named django so there we go coding with mitch chat dev does not exist oh because i named it incorrectly so let me try that again i'm going to delete the one that i named incorrectly here my bad sorry about that so let me delete that and now i'm going to create the correct one so create database uh coding with mitch chat dev that's spelled correctly this time and then the next command is grant the privileges so as soon as this is created boom there we go now grant all privilege privileges to that new database to that user django and there we go now we're ready to go so we've basically just reset everything we now have a clean slate but we have our our new user model that we're gonna that we're gonna use so now our database is completely clear and we can create a new super user but there's one thing we need to do we need to go into settings.py first and set a parameter in here called auth user model and set it equal to account dot account so i'm referencing the whoops this should be auth user model the account app and i'm saying look for the model named account i'm going to press ctrl s on that now this is telling django that the default model for authenticated authentication sorry is that that model that we just created so now if i open up command prompt and i write python manage.py well actually first we need to migrate so python manage.py migrate you'll you'll see some migrations here i've actually already done it off camera so what you'll see is a bunch of migrations being applied here so just ignore that i have nothing you should see a whole bunch of stuff now i want to do python manage.py create super user and so you notice it's asking me for my email first before it used to ask for the username now it's gonna ask for the username it's gonna ask for my password my password again and now i have my super user created and it's it's been created through that function that we created in the model so what it did was it used this this function right here create super user so now that i have created that super user i can go to the admin i'm going to refresh this notice it's asking for my email right now it's not asking for my username anymore so i'm going to type mitch at taving.ca and there's my password and it looks like i'm getting an error now it did work the authentication did work but the problem here is actually with the admin because we've changed the the default user model we also need to change what the admin panel is going to look like it doesn't know how to handle that new user model that we just built so if i go to the home page notice i am authenticated so this view is saying that i am authenticated it's just that the admin panel doesn't know what to do with me it doesn't or when you try to navigate to that user section it doesn't exist so we need to we need to build that so going back to sublime text and going into admin the admin dot py file inside of inside of account we're going to customize what the admin panel is going to look like considering our new user model so up at the top here i'm going to import a couple more things i'm going to do from django.contrib.auth.admin import user admin and then from accounts.models import the account so that's the account model that we just built now i'm going to build a new model admin class so class account admin pass user admin that's like the the class that we're extending by now i'm going to set some properties so list display is i'll actually just write it out and then i'll talk about what each one does it's just easier when it's done because then you can actually see it in action so i'm going to do username we'll first email username date joined and let's do last login is admin and is staff you can pretty much do whatever fields you want here although i recommend definitely using email and username now i'm going to do search fields again i'm going to explain these when we take a look at the admin panel not right now i want to just type them all out for now now read only fields and set that equal to id let's do date join we don't want them to be able to change that and also last login so all these all these fields should never be able to be changed by the admin those are automatically changed or generated by the system uh filter actually i don't need to add any filter options that's fine now i want to register that that new admin so admin dot site dot register uh pass the account model and then pass the account admin so that's the new admin so now i'm going to save that and we don't need to restart our server or anything like that we can just go right to the admin refresh this and this should show a view that's been updated it looks like we got an error let me just check check the console here okay so it's saying that i need to have have some filtering options well i actually don't want filtering options so what i need to do here is actually just set them to nothing so i'm going to say filter horizontal equal to nothing whoops list filter set that equal to nothing and also field sets and set that equal to nothing so saving that let's go back to the admin refresh this and there we go so now we have a new section in our admin called accounts and if i click on this it's going to reflect how we built that admin class so notice these fields here let's go back to sublime text and i'll explain these so list displays email username datejoin last login is admin and his staff those are the fields at the top here email username datejoin last login is admin and staff those are how you define what fields get shown at the top the next one was search fields so search fields is going to be this right here so if i was to search either their email or their username so if i search mitch or the email those are the fields that can be used in that search view the last is read only field so id date joined and last login those can be seen if i click on the model and i look in here notice id date joined and last login those are all read only those can't be changed by me everything else here can be changed other than the password of course i can't change that also i can't see that so email can be changed username all these booleans the profile image all that kind of stuff also another thing to check here is did our profile image correctly get set so is this profile image working well if i click on this it says note 404 and i actually do know why let's open up our project so if we go into notice what it's trying to find it's trying to find media coding with which logo and trying to find that it's saying uh this this pathway does not exist right here so media cdn coding with mitch coding with which logo does not exist okay so go into static cdn go into the coding with mitch folder and grab this logo 1080 1080 picture so press ctrl c on that now go to media cdn coding with mitch and paste it in here now if i refresh this it should find that image so there we go there's our default image so we know that it is actually working uh this guy has a default image set to his profile all right so we have our admin setup we have our first super user the next thing is logging in with a uh with the wrong case so if i was to like go and log in and do mitch at capital t tabian.ca this should not work and it shouldn't work because of that capital so if i press log in yep both fields may be case sensitive so this is not really a good thing like if somebody accidentally presses a capital that should not be a problem especially because inside of our code instead of the models we're normalizing the email when we create a user so it's always going to be lowercase so what we can do is actually add a case insensitive end to the user model so that when they log in it's going to be case insensitive so what i'm going to do is go into account i'm actually going to minimize some of this stuff just to make it look a little better go into account right click create a new file a new file called back ends dot py and inside here i'm going to create that case insensitive model back-end that we can set to our user model so from django.contrib dot auth import the get user model so this is how i'm getting my user model for this for this file we could have also imported settings and just got it that way but either way works the same back django.contrib.auth.backends and i want to import model back end now i'm going to create a class called case in sensit insensitive model back end and reference that model back end class now i want to create one function called authenticate so i'm overriding the authenticate function so i'm saying when users authenticate do this instead so request username equals none or the default equals none password equals none of the default equals none then keyword arguments so my user model is going to equal get user models that's going to get my default user model that's set in the settings.py file so it's going to get this user model right here so i'm getting the user model i'm saying if the username is none then i want to do username equals whoops username equals keywordarguments.getusermodel.usernamefield so i'm getting the username field from the user model which would mean this this field right here username field now i want to do try and accept and the accept is going to be user model dot does not exist does not exist so if i can't find it then what do i want to do i want to do user model initialize it set a password so basically create a new one and set it equal to the password otherwise i want to do case insensitive uh case insensitive username field so this is actually going to be the the email in this case i want to do squiggly braces underscore underscore i exact and i didn't come with up with this by the way i found this either in a stack overflow post or on the django documentation i cannot remember usermodel.usernamefield and then i want to do user so i'm getting the user user model so this is if they actually do exist dot default manager dot get star star squiggly brace case insensitive username field and then semicolon or sorry colon and then username so again i did not come up with this i don't really know exactly how this is working this is some kind of python magic but basically what it's doing is it's getting the field the case insensitive username field in this case that's going to be the email then it's getting the user based on that email with by using the case insensitive version so it's getting rid of the getting rid of the capitals or getting the case insensitive version now otherwise so that's the accept case otherwise so we're gonna have an else case for our if block up here i can kind of clean that up otherwise i want to do if user dot check password check if the password is correct and self.user can authenticate and pass the user then we want to return the user so this is the the login you can just copy this for any one of your projects it's going to work exactly the same as long as you're using actually yeah it doesn't matter even if you're using a different username field whether you're using the email or something else maybe a number it doesn't really matter this is going to work the exact same way it's going to make sure that they're logging in and it doesn't matter if it's if it's a capital or it's a lower case so now how do we use this monstrosity that we just created well i'm going to save this and go into settings and just below the auth user model that i set here i'm going to set a couple authentication backends so authentication backend so these are kind of like things that we want to happen in the event of an authenticated or a user trying to authenticate i'm going to use django.contrib.auth.backends.allow all users model backend and the second one is going to be that that case insensitive backend that we just built so i'm referencing the account app that we just built accounts.backends dot case insensitive it's an insensitive model backend i should actually make sure i spelt that right so i'm pressing ctrl c on that i'm going to go to back ends and just pasting this in just to make sure that i i spelt that correctly and that should be good so let's go to settings make sure i save that now let's go to try and log into the admin again so if i refresh this actually just go back to admin now i'm going to do at tabian.capitalt just like i did before press log in and boom i can log in even though it's a capital now so if i'm logged in notice the profile image is showing up in the corner here we want that same kind of thing for our development environment so if i go to the home page and look at the header that is not showing so let's go back to our project and we just need to do one simple change go into header.html i'm just going to search for img so i'm searching for any of the image tags inside here and instead of showing that default image i want to set the the user's profile image so i can do two squiggly braces i can do request dot user dot profile image and then dot url so i'm accessing the user object the the the authenticated user object accessing the profile image field and then saying get the url for that so i'm going to copy this and look for the other image tag in this template and then just paste in the same thing now press ctrl s go back to our development environment refresh this and boom there is that default profile image so we covered a lot of things here but i wanted to make sure i covered kind of everything to do with the custom user model kind of all in one video so we we built a custom user model we cleared the database to uh make make the migrations and make sure that it uses only that custom user model that we created we you know told django that hey we're going to be logging in with the email field not the username field which is my preferred way to do things we customized the admin console to show like the fields that we want to show the ones that can be edited can't be edited oh we built the the custom model backend so that no matter if they use a capital accidentally when they're trying to log in that's not going to matter they're still going to be able to log in and then last but not least is we set the profile image in the header oh and by the way keep in mind that like the stuff that i did in this video you could pretty much copy paste and use in any of your other django projects all this stuff is pretty much going to be the same other than you might have some you know extra fields in your account model or maybe less fields depending on the way that you want to set it up but all the stuff here is is very generic you know you can pretty much use this in all your projects which is which is a great thing now if you're watching this video on youtube don't forget to go to codingwithmitch.com because if you register on codingwithmitch.com to watch this it's still free it just tracks your progress and gives you extra links in the description or down below the videos for more information on you know the things i talk about in the video some of these videos are long and i actually inside of the inside of the description for the course or inside the description for the lecture i actually put links to all of the code changes that i make in the video so if you want to kind of go through it quickly maybe you don't want to listen to me for like i don't know what this video was 30 minutes probably if you don't want to listen to me for the full 30 minutes you can just check the code down in the description of the video and see what needs to be changed so i highly recommend going going to codingwithmitch.com and watching it there there's a lot of added benefits in the next video we're going to work on registration so now we have the the account model all set up we're ready to like register to log in to log out all that kind of stuff so next is registration you
Info
Channel: CodingWithMitch
Views: 21,373
Rating: undefined out of 5
Keywords: django custom user, django custom user model, django custom user model authentication, django user model, abstract base user in django, django email login, django email register
Id: SFarxlTzVX4
Channel Id: undefined
Length: 39min 21sec (2361 seconds)
Published: Tue Oct 06 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.