Hello, friend, welcome back.
In this video, I want to discuss about how can working with the users sign up option?
So for the users sign up option in Django, they have sold the building class like here.
If you go to that documentation and if you start with that user, that means that using that django
authentication.
So the documentation here, if you succeed, then you will get some of the resources.
If you go a bit down and here that have out, you consider that one of the class as a password change
from there is one of the password reset form.
And also there is a password that said password from and also will discuss about that things with you
later.
And then also there is a user creation form and into the U.S. form.
When you use this class, when you use this class by default, you will get some of the field is actually
providing some of the feel for that user name and the password and the password so that the filename
as a password one and the password to.
So with using this class, that means that U.S. class will get this tab, all that field.
And with this field you can create your sign a portion for your user.
So you can do that work.
In this video, I will show you that things with the live example so far working with this form.
First of all, we have to do we have to import it.
That means that there are positive reviews, that we don't need this.
I just simply close everything.
And now I want to work in this application.
That is our app logging application, as I told you, which is related with our authentication.
Everything I want to save, in particular this application area.
And here, first of all, we have to do we have to go to our view and into the view area.
First of all, I want to do on to empower this class.
That means that user creation from class.
Right.
So fundamentally is step by step, everything will be more clear to you.
So for now, I want to do want to take it that is in our form.
And then Django.
So from the Django, that is a country form to the country and then that and then the forms.
So from the forms here, from here, you have to able to input our this class, our class name.
As I told you, that is our user creation form.
Right.
So I just simply copy it.
And now here I just simply import it.
So make sure you input it.
And as I told you, when you imported it, providing some of the form of the value data, that means
it's actually providing for the field as a username password and the password, too.
So I want to do I want to create all of the function and I just name it function as a whatever you want.
I know.
I name it as a sign up.
I can sign underscore sorry, saying underscore app.
So this step up on the function name I want to create and this function here, as I told you, it will
be passed on the request.
Right.
So it should be passed on the request.
I just simply pass on the perimeter as a request parameter and then I take one of the variable as a
form and into the form variable area here I want to create of the object or this class object.
So that is our education from here.
I just simply created OK, and then here I want to do want to make that our start as a false.
So we decided this fall.
That means first of all, design a portion will be as false and then I will make that as a true.
That means when our total data will be saved and after that I want to make that user at the register.
So for the reasons here, I take the register
register and I make that register as a false.
It will be as it falls for the first time.
And then I want to pause on the condition as if condition and receive conditionally and forward from
here.
Also, I have to do I have to create one of the template and from the template area we have to load
our form.
Right.
So that will be what the Post matters right now.
Want to do that work in our function area.
That means here I want to put on the if condition, if already exist, one of the requests that I want,
I will pass from another page, that bizarre form piece.
So here I just simply take it as a request and method.
So that will be our method.
And first of all, it will be check it, it shall be checked.
That is actually our post or not that in the post or the gate.
First of all, it will be check it.
Right.
And after that, I want to do I want to take over this user that is this form and here and simply load
it again.
So that is our form and the form area with our this user.
We thought this user creation form here.
I want to want to pass all the data, all the data we get from our post.
So I just simply pass it with the request.
So that means our distinguished data.
OK, I just simply passed it.
And here, first of all, I want to do want to actually take our distinguished data with the.
The variable so here I name it as a data and I just take that our requested all the post and I just
take it with this variable.
OK, that is our DNA variable.
And after that, I want to do I want to make as a validation.
So here I put out the if condition, if our form, if our form is valid or not.
So I just simply added as the ease underscore valid.
So here I want to check it.
That means this form that is valid or not.
So if it's valid, then I want to do want to save our D from all the data.
That means our form, that is our form and I on the line to save this data.
So I just simply save it.
And when this data will be saved, first of all, here I make our registered as a false and No one to
do and to make that as a true.
OK, that means here I want to do.
I know when this data will be safe here.
I make that as a true.
So then it will be as true.
So right now we have to do we have to pass all this information that means the register information
to the base.
So here, here I want to do and written and written and with the render that means our with our descender
method.
So with our descender method, I want to do I want to pass our first of all, it will be passed.
That request, as it will do, is pass through this parameter.
One is at the request, one is the request, and that is the final location.
So now in our app login, that means into the app logging area, I would want to create one of the file
that bizarre our form.
What exactly?
I want to put our form.
So I just name it as a sign up DOT estimates.
So this step up on the pace I just simply created in our app logging.
So here I don't want to load it.
So that is in our app logging app sorry app underscore logging app logging.
So from to the app logging.
I want to get out this sign a form that is HTML.
OK, so I just simply load it.
So now we have to do, we have to pass out this.
So that means when this, our history is complete, when our form is valid it is perfectly OK.
And then I want to save this our form data.
That means our industry is complete.
Right.
So after that, this information we have to do, we have to pass it.
We have to pass it in our context area.
So if you want to pass it.
So here, here I want to take one of the variable.
I just take that variable as a decision or whatever you want.
So now I just name all the variable as a dictionary and written with the dictionary.
We have to pass that information.
Right.
So here we have to do we have to take one of the key.
Our key will be our form.
I name it as a form and then that will be as a form.
So I just simply pass it.
And also here we have to do we have to pass out this information that is registered.
So that will be our key.
I just name it as a register.
And here I also want to make that the register so no one to enter the password.
This data that means this dictionary that are, you know, this base that we see in our sign of protest.
Tamalpais so if you want to pass it so here and pass it with all the context, I take one of the variable
as the context.
OK, with this context here, I just simply posit that means from here I pass or form right from here.
I have already loaded out this form as a user creation form and then take the things with this variable.
And also here I pass it that mhere here I pass our on of the form and also I pass that register.
Right.
So I pass that data that the addition that I know I sign about is Tamalpais.
So now we can actually use both of these.
So it's to post about Shoyu.
So now I want to go on to working or sign up at this table.
That means here.
So here first of all, I want to do want to load our business.
Jammal, that means if we go to our blog list and negotiate the block list area extended our base estimate,
it'll be just like that same letter I copied.
And now, you know, sign a portion here I it so shall we extend our basis to email.
And also that will be a sign on the block title and this block title for this.
It shall be as a create create new account
as account.
So that will be our title and that is our and title and that is our body blog.
And in the body blog it Yadav that's on the H1 text submittal.
I want to make as I create create new account.
OK, this will be displayed as a create new account and I want to make that things as a text.
Then it should be better.
I make a list to protect and here I want to do to load one of the forms.
So that is one of the original form I want to load.
And here we don't need any class.
So I just simply removed that class and then that is our action.
Also here, we don't need to add any action automatically to reject it.
And that is our post method.
Right.
So from here, that post my thoughts, so here I first of all, I take Jackett without this matter is
posted a not so for now that I just simply added as our format will be as a post.
So now here in particular, this form area, I want to download our form.
That means our default, our class form.
That is our user creation form.
And here I take the things with this variable here I pass it in our dictionary area and with this I
just simply pass it in or sign up as Tamalpais.
Right.
So now that is a flawed form.
So now in particular this for I just simply load our default Django form in here.
That is far from perfect.
And also after that, I want to do bad on the bottom.
So that will be as a button bottom type will be at the submitter.
So it will be at the submit time.
And here we don't need any name.
I want to do a report on the class.
I want to put on the class as a witty and witty and that is one of the bootstrap plus success I could
be in between success and median s.m.
OK, just name it as the same.
That is small size.
So that will be our bottom type.
Perfect.
And our bottom name will be as a create account.
So create account.
So it will be as a create account and also that this will be our sign up right to the sign up.
I also want to add another link for our lodging.
So if you want to do that work, you can do it so often in this section.
I don't want to actually.
I'm focused on creating some of the design.
So many more things.
I want to discuss that things with you.
OK, so into the beer area.
I take one the paragraph and here already have an account.
So if you already have an account then you can logging's.
So this step up, one of the link I want to put it should be the logging here, OK, logging here.
So in particular, that position we have to do have to put that our logging you out.
And also from here I pass another parameter variable that is our registered.
Right.
That means, first of all, that is our registered as a false and then I pass that as it is said, that
is when this account is created.
After that, our decisions that will be added to.
Right.
And also here I pass it.
So I wanted to put this tape up on the condition when our submit form will be completed that we saw
in this user will create this account automatically, which will be sure of that, a large success message.
So if you want to do that work, you can do it very easily.
So for doing this, that is our end blog.
And here there is our body block.
Right?
So the body block area.
So here I want to put on the if condition.
I just simply put that if if our that means from here I pass it that the register that receive this
user is already registered.
OK, so if this user is already registered, then it shall be displayed some message.
So I just take one of the dev and I just thought that this class will be on the bootstrap class of the
alert alert, a large success.
So this step up, one of the class I want to display and here it will be displayed as I count.
OK, account created, created successfully.
So the step up on the message will be displayed.
And also here I put on the is better for the logging logging here.
So this step up on the success master will be displayed and else that means here I just put that another
else.
OK, else it shall be displayed out this another portion.
That means it shall be displayed out this form.
OK, so Elsas will be displayed this from that means when you want to create that use, if this user
is not created then it should be display our form again.
That is our default from again.
Right then it will be displayed out this message and everything ls and after that here also you have
to do we have to end it that this we have to and our if condition either simply and this is a condition
of a friend, I hope everything is very much clear to you.
So that is our form.
So that is our usurpation form and I pass it.
And also the result is that our data that if this user is registered and instead we display our this
message rather than it should we display our this form perfect.
So for now, if we want to access it, that means if you want to access our design, abductor's Tamalpais
for access it.
We have to we have to create one of the.
You are right.
So here we have to create one of the other tools for access our design space.
So how can do that work better and to continue this process in our next video, I will show you that
things with the.
For example, so thanks for watching, I will see you in the next video.