Hello, friend, welcome back.
In a previous video, we successfully complete our legal position, so right now I want to do I have
already complete our station locking and the logout.
So here I want to define this step up.
One of the main condition when this user will be locked in the in our D register and the locking button
not should be visible.
And when this user will be locked out, then our D register and the locking will be visible.
So that is the condition we have to set.
So here we have to define some of the condition in our menu area.
So there is the menu I have defined in our base system.
All right.
So now go to our business HTML security, pretty easy things like here into the basic HTML.
I have defined all the terminal so no one to do and to actually our take this all log out.
I will after this locking.
I want to define this, all this log out.
OK, that means that the cloud logger portions.
So now here I want to define the condition so I just simply define the if condition.
So here with these percentages I defined the if condition, if our user, that means this user and also
they have another function as it is authenticated.
So with this we can actually defining each side as simply defined as ease, underscore, authenticated
the ID.
So that is not indicated.
So if this user is authenticated that this user is logging, then I only want to display our home and
the log button, OK, and else it shall be display our register and the logging.
So now I want to do and to define another Ayles.
So I just simply defined that ale's right.
So Ilse's will be displayed our display of this position.
And then here after this, I have to do have to finish it.
That means I have to finish our.
And if condition and just simply and our condition.
OK, so that's all you have to do.
Now let's check this out.
Everything will be due by this hour.
A function that is authenticated function.
Now, if you click the save all and now if you refresh it.
Yes.
Now you can see right now I'm not logged in.
So for the results, our home and our logo is not visible.
You can see right now I am not logging for the reasons.
First of all, it's subjective.
And when this is shaky, this user is not logging by default.
They have else option.
Our this register and the logging button is now visible.
And when you logged in, then our.
That means when this user is authenticated and then our home button and the log button only visible.
Now let's check this out here right now in the logging, I just put the Karzai and the password and
then click as login.
Yes, you can see friend after that logging now showing our home and the log out, specifically the
log out.
And then you can see snowshoeing at the register and logging button.
So now here I want to do when this user will be locked in.
That means here if you pulled appropriate user name and also if this proposed appropriate password and
if it is a logging.
So here you can see snowshoeing showing our home page.
So into this home page, I want to do I want to display appropriate this user all the details that mean
this user user name email.
That is the URL and also the picture here.
I want to display it because of all when we register it, we register by the user name, email the password
and also the emails and the Facebook idea.
Right.
So no one to do this will display all that information, in particular that area after this logging.
So here also we have to do have to define that things by a specific user ID data.
Right.
Because when you logging with the Karzai, then we display all that Karzai details.
That means Karzai details will be visible.
When you logging with the Ardian, then it will be displayed all the darrian related all the data.
So how can do that work for doing this?
We have to do we have to work in our index because of all that is our index function.
So now go to our view and into the view area.
That is our index function so that the index function right into the index function area we have to
work.
So here we have to define that.
All the things on here like here I have to do.
I have to first of all, define the if condition and then our request and this request our user.
First of all, this will be displayed, our authenticated user.
So if you want to find out that authenticated user, I have already discussed about that things with
you that have another function as it is authenticated.
And now I also want to define our this requested user details.
That means here I take one of the variable of the current OK, GARANT and then user and then this request
and that is requested user.
So this is to go to the user.
I want to do I want to get all the data.
Sorry user.
I want to get all the data like here if you want to check it.
I want to check it first, then it will be better.
I want to paint it, I want to print our this current user.
That means here I take the things with this variable that requested user.
So just simple.
Defining it, this kind of user, I want to access that user name and also I want to print I want to
print out this current OK, this current user I email, that's all that our database will actually write.
And now also, if you want to check that I did that this current user is already authenticated, in
particular that position with this current user ID, if you want to also get you can also get it.
So I just simply defend the print and then the current current user I.D. that our database table filename,
as I decide, just simply defined as the idea on here.
OK, so now I want to check it.
Like if you click the save all I you that the things we display on here, OK, everything is now running.
Well now I just refreshed this space so now we should be getting all that this user data right now I
am already logged in.
So now if you open it now you can see snow perfectly display as a Karzi and it's perfectly defined our
the other Gmail dot com.
So here are defined as a user name, email and the ID and this crazy ID actually the two.
So now I want to do I want to get all the data with the specific, this idea that this user data and
to get the things with their specific decided.
So if you want to get it.
So I don't, I don't need this.
I just simply remove to of this because here I want to get this laptop with a specific this user idea.
Right.
So now I have to do and take one of the variable as a user.
Underscore, sorry, underscore basic info, basic info, whatever he wants.
Right now I'm using as info and then what exactly you have to do with our user model.
So we have to also import this user model.
So with this user model, I want to do and define our object, OK, with this object, I want to do
want to get this data that means our primary key, our primary gear.
I have defined that things with our current user ID.
So for now I want to do want to take the things we don't know, the variable.
OK, so here we don't need this printed because I have already checked it.
So here I take this data that means specific.
This is our data and take the things we don't know.
The variable as a user underscore ID.
So I just take this, our specific current user added data and take that things with this variable.
So into the primary key area we have to do.
We have to pass it right when I hope is very much clear to you and the rest of this will be the same.
And then also here I'm using that our user.
So we have to also include it.
That means we have to import it.
OK, so here I define as a form and that Django and the country art and the models.
OK, and then I want to import our user.
So to simplify that user.
Perfect.
So here I want to display our user details.
So here I have already defined our user with this user.
We will get all that our user email address and the user name.
And also I want to display our Facebook ID that in the Facebook Eurail.
And also I have defined another one as a.
Profile picture, so if you go to our models, you do the models, I have defined all the things you
can say.
I have defended Facebook I.D. and the profile picture with this model.
That means our user info model.
So we have to also put it we have to also put it in our view area.
That means here.
OK, better after this.
I want to use it as a form.
So that is in our application, in our logging application and the logging application.
That is our model.
Right.
So now it is simply of the logging that we, you know, logging app.
And then here there is the models.
So into the models.
I want to import into this from this model.
I want to import what I want to import our this model that we model plus as the user info.
So we have to use it.
So I have already get all that our email address and our user name with this user.
And now also we have to get all the data from our user info.
So here that is our message.
So from here I have already get our user details.
That means they use a name and email address.
Now I want to do undertake another variable as a user.
More info, more underscored info.
And from this, I want to do want to use our LOURD model or model.
Is it user info?
Right.
So that is I have already imposed this our user info and into this user info area from here and the
of the object sorry objects.
So with these objects I want to do and get our this primary key.
So if you want to display this primary key here, you have to define our this model.
And in this model area you can see I have also defined on big.
So here I have already created the relation that is a one to one relation.
So if you want to display any kind of want one deletion primarily, then you have to define that things
with our first of all, that the user because of all here, I take that things with this user.
Right.
So with this user.
And then you have to define double on the line and then the primary key.
OK, so now our primary.
I have defined our primary that in the current is the primary key.
Take the things with this user ID, so I just simply pass it on here.
OK, so now so we successfully get all the data from our table.
That means that with this user model we get our email address and also this user user name.
And with this we that means for our user info model, we get our two of these data as a Facebook Eurail
and also the profile picture.
And also here I define with the specific primary key that this user ID and that this current user ID
details.
Right.
So we get all the data for no one to do and the visible sound visible in our index.
That means that is actually our index e-mail.
So now go to our template into the template that is our index estimator.
So if you want to access this, all the data we have to do, we have to pass it right.
So here we have to pass it after this.
So after this, I take as a dictionary, as a D and then our we have to pass all that, our detailed
data.
So from here we have to pass our user basic info.
So I just simply pass it as a basic info.
And also after this, we have to pass out another filter that means our user more info data.
Right.
And I think everything should be very much clear to you because I have explained everything.
So now also we have to pass out this one.
So here we have to pass it.
Right.
So now I have already passed everything in our that is our user details data and also pass our that
is our user.
All that you have Facebook you are and the profile picture.
And also now we have to do we have to pass out this dictionary in the context area.
So I have already passed it.
Perfect.
But now we can actually access all that our little data.
That means user messaging for data and we use our Moreen for that in our indexed e-mail.
So now I want to display in our indexed e-mail go to here.
So here we have displayed so friend better want to do and to continue this process.
And in our next video, I'll complete the total part.
So thanks for watching.
I will see you in the next video.