Hello, friend, welcome back.
In a previous video, we successfully locked in, right, so here we successfully complete our locking
position.
So right now I want to do want to work for our lock out so we can do working with this lock out.
First of all, we have to do we have to create one of the method that means we have to create the function
in our app locking and the Vaidya.
So there is a locking function.
And after that, after that, I want to do to create another function for the lock out.
So if you want to create that function with the Dave and I just name it as a logout user logout underscore
user.
So that will be our logout is around here.
Also, we have to do have to the same as a request and then we have to do.
I have already and I've already loaded our logout mattocks with this logout method.
We can do that work very easily.
So I just simply added our logo and the logo area.
We have to past our request.
Right.
So then after that here I want to do quaintness will be successfully logout.
What exactly should be detected.
I just make as a return and return with our EDP EDP response to direct here.
I want to do the reverse and would the reverse.
I want to do all the positives will be redirected to our logging base.
OK, so for the logging, I have already created one of the you you know, our app logging and at the
URL.
So that is all logging.
Right, so that your signing piece is will be redirected to particular displays.
And now here I just simply added our signing that this to be the key to a logging base.
And also here I want to do one things like when you want to access this function, then this user must
have to be logging.
That means we know what this log out optional will work.
First of all, this user must have that logging.
So that means the logging will be required for access or this method.
OK.
So if you want to do that in Django, they have another method as a logging request.
So that is in our decorator's.
So here, first of all, we have to do we have to import it.
So that is in our FROM and then Django and then country.
So that is a country and form of the Django entre sorry.
Or and then the decorators from the decorator's.
I don't want to import one of the matter that the logging underscore Ricot walking on whiskery good.
So with this logging required you can make your function.
That means this function as a recursive Frontex as this function you have to must locking.
OK, so now I want to use it.
That means for all this log out here.
Here I will have to we have to just simply add that logging that means first of all, this user must
have to be logging if this user wants to access this log out function, OK?
And now I want to do and to create on the wall for this logout user.
So you know what you are so here I want to do to create a new one and then just name it as a log out.
OK, just name it as a log old and also name that our these so of the log out.
And also in our view area, I have created one of the function function name as a logout user.
So no, I just simply load our dis log out the user.
So no I want to do want to add that our e what.
I want to add that you order and here I want to add another.
So if you want to do that work that is our basis.
HTML so go to our basic HTML and into this page.
That is our menu.
Right.
So here I want to add another one and I want to add another one for the better.
I want to add another one for the logging so it will be as a logging.
OK, so we have the logging and then I want to take another one better here, here and take another
one for the log out.
It'll be as a log out.
So it'll be either log also for the logging.
I have already created one of the you what are you are a name in our app name as the app logging and
then our signing.
Right.
So here I name it as a signing and for the log out in our mind that is, you know, our app logging.
That means our app name with this app logging, we can actually access all this log out.
So that will be our app logging and the log out.
So friend here I want to do want to add one of the condition, like when this user is already logging,
that means when this user is already authenticate, this user can access at this two of this that this
home and the log only visible either then our this sign up and the logging will be visible.
OK, so you then everything will be more clear to user here.
I want to put one of the condition I just added one of the if condition.
I just.
If condition, if that user that is also one of the by default user, I want to use it and also the
monitor my policy is authenticate.
Underscore is underscore authenticated.
So this is authenticated methode.
We can add it.
So first of all, we check it if this user is authenticated that perceived this user is login.
So then our two of these men will be visible and else.
So here I want to do and to add as the URLs else, our first of these two men that want to have this
manually visible software that here I want to do want to finish our if condition at the and if I hope
is very much clear to friends.
So I just put one of the if condition.
If this user is authenticated that this user is login, then it shall be displayed our home button and
the log button and else is be displayed our sign up button and the logging button.
OK, so here I want to check it like here if you click on the save wall.
So first of all, I want to check their server.
You can see they have some of the Airaud as a logout request, so the log goes ahead showing the invalid
Syntex.
So go to our view into the view area.
That is our request.
You can see I just use that as a dispenser here to not need be will be needed on here.
That will be our local request.
Perfect.
Not like at this table.
And I want to check it here.
You can see everything is done perfectly running.
Now go to our site, refresh it.
Yes.
You can see right now, I'm already logged in for the reasons here because there are two of these men
visible here.
I just simply added that condition.
If this user is authenticated, our home button and the logout button on the visible ale's, that means
if this user is not authenticated, if this user is not logging, then our two of these men will be
visible.
Right.
So now if I know I'm already logged for the reasons he's showing us the home and the log out, so not
only just click of the log out, so here you can see snowshoeing as a sign in.
Not can't understand what exactly the things I did.
You can see the reverse area I added as a sign.
And so also we have to do we have to add our app name.
That means here that is our app name.
And after that name we have to use our design in.
Right.
So right now here.
So first of all, it will be our app logging and then our signing.
That means that is actually our logging.
So now I just click as save.
So friend here indexes perfectly working because of all in our index area.
I didn't add any app logging.
Like if you go to our main site, that is our main block project.
If we go to that you URL here, you can see here I didn't add any app name.
So for the reasons our direct contact with our directory, all parties working so that your name is
working, but here you are only added one of the app name.
So that will be our app name.
First of all, you have to add it and then you have to call that your name.
So now I just have to save all here.
I just simply updated it.
So first of all, that will be our app logging and then our signing right now.
Let's check this out.
If you are going to go back and refresh it so you can see it's already logout.
Step is all log is perfectly working so you can see when it should be.
This user is log out, then our tool dispenser visible.
That means here right now, our sign up and logging menu is visible right now.
I want to log in again and log to that our user name as a test.
And you give me one, two, three, four, five.
Now click as a login.
Yeah, you can see it's now becoming updated menu as a home and the log out.
Right.
And then that is our home page.
And if you click as a log out now, you can see it's not perfectly successfully log out and sign up
and the logging is visible.
So home is actually needed.
Embitter.
I want to do Underbool.
I make the things from here.
I got it.
And before I added and after this for this log out, I want to do I want to make out this authenticated
because of all for our home base with that home base will be needed right now if you click disable and
now if you refresh.
Yeah, you can see snowshoeing as a home sign up and the logging because of all right, now I'm not
logging.
So for the reasons it's not showing our tree of this.
So that is showing our home and then our authenticated our logo to the visible point.
This user is authenticated.
That means when the user is logging, OK, again, I want to test it.
So I make the test.
You do me one, two, three, four, five.
Because of logging.
Yeah.
Now because it's not perfect, visible as a home.
And then I will log out.
So that is our home.
Basically there's a log out.
It's not perfectly detected to logging paste.
So here I just simply add that condition.
So when it will be as a log to then it should be returned.
And our Utah is TDP responsibility.
The reverse I used will be passed to our app logging sign in base.
Right.
So you can see it's not perfectly clear or logging base so friendly successfully complete our log portion.
We successfully complete our sign up and the logging portions.
Right.
So from here you can sign up, you can logging and also you can log out.
So now I want to do want to work with our some of the user profile, like when this user will be logging
and for this user there should be some of the profile page.
So can working with the user profile in our next video, I will show that things with a live example.
So thanks for watching and I will see you in the next video.