Hello, friend will come back in a previous video, we set up our pulisic for our e-commerce site.
So that is our politics right now.
We already set up it.
So now we're going to do and to create one of the model.
And this model will be a little bit different from our previous one, because previous all the tail
section, we have used the default one user model.
So now we will create this user model look.
So before we enter the user, we already get all the tower building feel like as the user name, password,
email address, fast name and the last name.
But right now I want to create our authentication system as part of our demand so we can create customized
authentication.
I will show you for doing this in our app blockings into the app logging, that is our models.
So here we have to work.
So now, first of all, we have to do we have to import some of the class.
OK, so here I want to do and get our form and the Django and then the country cantrip.
So from to the country, then the art and then our models.
So from here I don't want to do some the building class as a best user manager.
So I just simply defined as a base user manager.
I guess I just name it as a best user manager and also I want to take another one as I was struck by
the user safety functionality, why I'm actually using it, I will show you.
But right now, first of all, I want to put it as I was struck, I was struck bass user.
And also I want to take another one as a permission mix, like a permission mixed in.
So there's all the building functionality.
So I will run it.
Then everything will be very much clear to you and you will like it very much OK, because here we will
create our own authentication system.
So here I defended Django, Django and the utils and then the translation,
so then the translation.
And from here I want to do want to import another class as a easy taste test and risk underscore lazy.
And so here there's all the tower building plans and now to learn to create another class class and
I just name it as if my user manager
so just name it as my user manager.
And here it will be in her late hour at this class.
That means there is a cloud based user manager class.
So I just simply defending it on here.
And after that I want to create one of the function.
And here I don't want to login with the user name and the password.
Here I want to logging with the email address and the password because of all into the e-commerce side.
We need that email address.
Right.
That means the customer email address.
So for the reasons I want to do, I want to make that functionality little bit different way.
So here I define the function.
I just simply define that function.
And here I name it as a producer, create underscore user.
So and then I have to also define that things with the self.
Right.
So yeah, I simply defended itself and here I want to do want to use that email field.
So here I define the email and the password and then we have to do we have to make that into our field.
So here with this, I just simply defined the extra underscore field, OK?
And after that, I want to do I want to define if is not actually not getting that email, then what
exactly the message is will be displayed.
OK, so here I am defining the condition as a if not email.
Let me see if this field is not email then it should be right.
OK then it should be like some of the adults.
So if you want to show some of the value or you have also to have another function as a value add or
OK, so with this value around doing the shows on the message, then it should be displayed as a and
by email.
Email must be set.
So this type of message is will be displayed after that.
We have to do we have to normalize with this field.
That means our DC Millfield.
OK, so here, if you want to normalize it, then I just simply define our email field and our email
field will be as self so different.
Everything is actually default.
OK, we have to actually do that work.
So that is all that the default functionality that we have to use.
I just simply defined as to normalize, normalize, underscore email.
And here we have to parse that our email.
I just simply pass it.
And then also we have to say to our users, so here we have to define that user with the self and that
will be as a model.
And with this model, we have to pass our email so our email will be compared with our email.
So here I just simply defining it says I told you when I actually ran it, then it will be very much
clear to you what exactly the update I have defining on here.
And it will be also here.
We have to define our X to feed our particular date area.
So you do the extra Valaria I want to do to add our user password.
So here I just simply defined that our user with this user, I define that our set password.
OK, just simply defined, as I said, password and our filename will be as a password, and then I
am trying to save this user, so I just simply defend this user and then save.
And here we have to defend that using so to simply defend it using and here you have to defend yourself
self.
And then dot underscored.
OK.
So that as I told you, sir, everything is by default on the building functionality.
So here I have defined that all the part as a normalized email field.
And then that is our email.
And here I want to add with our email and other stuff that is already our password.
OK, and after this, I want to do I want to return this user.
So just defined as a return user.
Perfect.
And after that, I want to do want to create another function here.
I want to create another function for our super user.
So here I define another function.
So I just simply define that, Dave.
And then I just put that function names here.
Now I define that function name as a create, OK, create, underscore super user and the super user.
First of all, I define themselves and for the super user, we have to define that email and then our
password.
Right.
And here, because of all that position I have already defined out of this field what will be our email
field and that will be our password.
Right.
So now I want to create another super user.
So I think you already know about the super user.
With this super user, you can actually access that the default Django admin area.
So now I want to do and define some the functionality for our admin.
So obviously, as I told you, we have used default one, but right now we will create it.
So it actually will run this functionality.
Then everything will be very much clear to you, as I told you before.
So here I create all of the function and I just put that function name as a create user.
And here I define themselves our email field, password field, and also I want to take another extra
field.
OK, so after this, I want to take another extra field and into this field area.
First of all, I want to do and to define our extra field, OK, extra field and into the extra field
area, I said are not the default values here.
I want to do a the different set default.
OK, so just simply defined as the default and the default area on the defense are the text.
So, you know, admin panel, they have some of the option that is a checkmark option as the easy stuff
that that means that is super user or the activities are done.
Not so you can set your all the trivialisation for the user.
Right.
So now we are actually defining that part.
So here I define that name will be as it is.
That is actually easy stuff because is all directly by default a building of the field in Django.
So here I am using as the easy stuff, OK, and also I want to do and make the things as a tool here.
I mean, so our.
OK, and now also we have to define another, another field.
So here I define the extra with the starfield.
I just simply defined as a set set default and also now trying to define another field.
So that will be as it is, underscore super user, like a super user.
And also I want to make that as a true, true and then also to do better here.
Here I take another extra field and extra field will be, as I said, default and into the default area.
I have to do I have to define our field as it is under its collective.
So here you have to put that appropriate name because that's all the default.
OK, so here I also want to do and make the things that are true, perfect.
So now on to the end of the final condition.
OK, I just defined is that if our this extra field is if it's the field, what exactly it defines as
the easy stuff.
So if this easy stuff is not true, because because of all here, I have defined that as a true right.
So Voynich will be not true.
I don't want to display some of the message, OK, I want do this without the message, with our value
or function.
So that is our extra field.
So into the extra field here, I defined that when we get.
OK, when will we get as our field as it is the stuff when it will be as if not true.
So I just simply defined as it is not true.
So when it should be not true then it should be like some of them.
I say that means that our message is simply defined as the rise.
OK, so where I saw the value error and the value error here, I want to do and display the terrorists
will be displayed as a super super user.
Mosse Tab is unnecessary.
Stuff like this stuff must have that impact the.
That are true, of course, this type of actually what the message will be display that super users,
their super user must have Eastfield will be should be added to the list.
One of the messages will be display.
And else also I want to define another one.
I defend another live condition and then our extra an extra day extra feel.
I also defend the gate and the gate area.
So right now, our this one that we saw in the our is super OK.
So when our is super field is not true.
So then also be sure of that.
Another message that used when I saw the message.
So to simplify the rise and then value the value at all, it will be show some other message as a super
user must have this.
That means in super is all true.
OK, so here, sorry.
Here it will be displayed this message and then I just make the things that the returned returned and
they're not with the self, with the self here we have to pass our this user.
So here I have defined that user without this function as a creator user.
Right.
So this self here I defined that our creator user so our creator user will be allowed the email.
So here a different email password and also our extra filter.
So here I am simply defining that extra feel like a friend.
And now after that, I also want to do want to take another class.
So here I want to do here I undertake another class and I just named the class as the user.
So for the user, I want to do I want to make the things that they have a strict class.
So shall we as abstract.
So that is our abstract, basic user.
So with this user also here, you should be extended with our another class as a permission.
So here I defined the permission mixed in and now I want to do I want to make our email field will be
as unique because with this user we kept defining it before.
That was actually but the following we have used so that now I make the things as email and email models.
OK, that means with these models and here that type will be as email Millfield type.
So simply as the email field.
OK, so that is the email field and I got this email field will be unique, OK, unique, so unique.
And also I want to make the things will be as a true that this email will be true and also it will be
null and now it will be as a false.
OK, so just simply defending it and now they have the all the tower fields.
So that is by default all that our admin field.
So this that is, that is stop.
These super are right to know.
First of all for our this one that means our easy stuff here.
I want to define some of the text.
OK, that means this will be put on the action on here and here.
I want to define that as a and one of the feel for this one.
Like I just simply defending the models like that will be the models for now.
Maybe it's a little bit hard for you to understand because of all here, you can see that output.
OK, when I show you that output, then every line will be very much clear to you why I'm actually using
it.
So now I'm using actually the easy stuff into the easy stuff.
There is a model and here I define the model type will be as a boolean.
I have Lynnfield, so I just really it to be as a balloon field.
And under the balloon field area here, I want to do want to define what the balloon will take.
So here we have to define that with the U.S. using text lezzy.
So with this year I have key this field as a mustafi status.
OK, stuffiest, whatever you want.
So that is actually one the Texas will actually say just in front of the stuff status.
So here, whatever the things will put it, will be displayed in step above the level.
OK, and also here on the ground to make the things as the default, false default.
And I just make the things that are false.
OK, just make as a false for this one.
And also here I want to do other shows on the helpdesk helped X means this will be displayed on the
text.
OK, so here I take one.
There is also another building function.
So in Django.
So here I want to do I want to use it as a health text.
So with this text I want to display some level text.
So with this, is that it usually, Lizzie, with this text here on the under defined sound text that
I want to visible.
And so here I define the design
designs.
So whatever he wants to design.
So whether this or that, the user can.
Lock in the site, OK, this tape of one of the textually visible and also here we have to do we have
to make that things in here and just pull that out, takes the initiative better so that it is.
And then I want to find another one.
I want to define another one for this one.
That is this field as it is active because of what this is active.
What exactly do you want to visible into the woodland area?
I want to just simply defining it.
So here with these models, OK, with these models, I want to do a different type type will be assembled
in Lynnfield and into the Bloomfield area here.
I also want to define the same things.
OK, here, I want to make that our this with this you just text.
So with this lezzy here I want to do and define you should be as active as you should be.
Display this type of one of the active and also after this it'll be shown on the Help Desk.
So better I just simply copied it should be shown on the Help Desk as a with the our users technology
designer.
What are you doing to change it now.
These users should should be treated like treated as active.
This type of what the masses are still visible.
OK, and also after that, what exactly you have to do by default in order to use the model here, which
by default get that username right.
So now I don't want to change that portion.
I want to change that portion user name to the email address.
So for the reasons here, we have to do, we have to define that part.
So here I define our user name field.
OK, use a name, underscore field.
So it shall be as in our email and our objects, our objects will be our my user manager.
That means here.
So that is actually our class.
So here I will this will be our this object to this object.
I have already defined all that or feel right.
So all that our feel that means here is should be said by the email address and the password, not usernames.
So for the reasons here, I defined that our object will be our my user that is manager.
OK, so here will be this one.
And also after this, I want to define our all that function.
So here I define that function.
I will be the same question.
So here after this, which will be as is self with the self here we have to do we have to pass it.
So I just simply from the Ripton sorry, I just refund the return and the self.
So with this self I don't want to pass out email so I just simply pass that email.
OK, and also here we have to define another one, another one function that is our day function and
here should be as a get full name.
So I just simply Defendor get full honors for name and it should be also the self and then also should
be redone.
It should be redone and the self, the email that miss all that user functionality field.
I want to change it to the email because here I don't want to define that field.
I don't want to exist it OK on here.
After that I want to do I take another one.
And this will be as a great shock.
OK, it underscore short mean so the self so the self.
Here I want to do two also defining the return and return with ourself.
Email.
OK, I just simply defend himself.
Email.
So here with this we actually defining our user names so they are user name.
We will be directed to our email so they there will be no exist without.
That means default on the default.
That was actually username.
So now I just make the things with the email and here is stand with our email in the full name will
be as email and the short term.
So that means every functional decision to remove.
And here I want to make the things with our objects.
I here define our my user manager objects class and with this class I have already defined two of this
field will be a selected one will be as the email address and the password a friend the now also we
have to do, we have to create another class, we have to create another class for our profile.
So that is also important because when this user will be created automatically for for this, user use
will be created another profile.
OK, so it's also important several would want to continue this process.
In our next video, I will show you how I can do that work.
So thanks for watching and I'll see you the next video.