Hello, friend, welcome back.
In a previous video, we successfully created one of the base for the change this hour before Dimmeys
and here, if you can here, they need to be addicted to our change profiles, MySpace.
And here I also added that choosing options.
So right now I want to do from here, I want to update our default profile image.
That means if you go to our profiles, for that is our default profile.
Right.
So now I want to do I want to update it.
So for doing this, we have to do we have to work in our this function.
That means our Adepero function here.
I return our day and our app login and profile picture address HTML.
So that is our picture at the table.
So that is our form.
So right now we have to do we have to work on here.
And also added as a and Citigroup because of all from here, I want to update the images.
So now let's do that work for doing this right now.
Better I just put that things on here.
And first of all, after this, I have to do the same condition that we did before from here.
That is actually our I passed some of the pull stripe that this our method will be as a post.
So now after that profile.
So here I want to do a first of all, add one of the if condition I make.
That is one of the if condition, if our D.
Seacrest request and then the method.
Right.
Then our method will still be girly girl.
First of all, I have to do have to check it.
That is a post or not.
So first of all, I take it and then I take one of the variable as a form and here I have to do I have
to pass out this class that meets our profile picture class.
And here we have to do we have to pass that our request post.
So that will be our request.
And then post we have to pass and also make sure here we have to also pass our request files because
of all.
If you go here, I ordered our that position as a Nazi type, as a multiplatform laterite.
So when you actually pass on the images, then also here we have to do we have to pass another one.
We have to pass that request.
We have to pass that request with our files.
So make sure you add that our request also will be at the fine, right?
And then I would want to put out again and the if condition that I want to validate our form so our
form and ease underscore valid.
First of all, I want to check it.
And if this is valid, then here I want to do I want to take one of the variable as a user and I just
name it as a user object.
OK, for now here I name it.
And with this form I want to do I want to save this data.
So I just save this data.
So before that, that means when any user change their default image.
So first of all, I want to actually put that comment as a false because of all I had to check it,
that this user is updated, this current picture or not.
So here we have to set it.
I show you everything will be more clear to you, like here I submit.
And with the Sabria I make as a comet comet a first of all, it will be as a false so it be as false
and then with this user object.
So with this user object I want to do on taxes or if you go to our model into the model.
So that is our users, we have to actually make sure that this user updated this our profile picture.
Right.
So for now, I don't want to update it on Texas or this user.
So here with this user, that means this user will be aware which user this user will be our this current
user.
So if you want to display that current user, that will be our request to do the right.
So as I told you before, that will be our requested user, Redfin's.
That means our user, which user is logging.
So here it will be equal to our current user.
So when it will be equal, then I want to do I to save this our data.
That means this user object that I want to save it.
So right now I save it.
And after that, when it will be saved, that means when these images will be updated.
So from here, when this image will be updated, what exactly should be rejected?
It should be redirected to our displays.
That means our profile is right.
So I don't actually pass the things on here.
So if you want to pass it, then it'll be as a return.
And then our EDP response.
Right, is to be response, redirect and then the reverse.
So with this reverse here, I want to do an opposite profile position to access that our profile page
that is in our app logging.
If we go to that, you are ill suited that you are.
Eladio, that is actually our profile.
Right.
So if you want to access it.
So that is already added.
Our decision to name our app name as the app logging.
So with this app logging on takes us our this profile.
I added our that is our app name and with this app name I want to access our part name, our part name,
I name it as a profile.
So no, I just simply added as a profile I hope is very much clear to your friend.
And after that that is Orender.
That means our redundant and then our base load it from here.
I also parse that our form.
That means it should be updated.
So now let's check this out.
If everything OK, then it should be work.
I first of all, I wanted to click on to save all.
And now, first of all, I want to check our server.
You can see our service now perfectly running.
Now, let's do that.
We're going to actually change out this default image.
I just refresh this page, not click as the change profile and now click on the tools file.
And from here, for irrigation purposes, I want to do the use of the image like I want to choose this
one.
OK, like open.
So that will be our images.
Now click on the add picture.
Yes, you can see when our default image is now become change and now to display our new image.
So that is our new image.
I have updated, I hope is very muscular to you right now.
That is our new image is updated.
And then you save this data and after points, then it's redirected to our with our SCDP response device
to our profile page.
You can see when it's updated, it's redirected to our profile page.
But here, one thing's like right now, I have already uploaded our new image.
Right.
You can see our button is not visible because of all in our profile page into the profile.
If you go to that profile, today's HTML into the profile of this table, what exactly I did.
So when this user will have any new images, that means then issue will be visible.
Our this part.
Right.
And Ayles, that means it will be as a default and the default area.
I have added another class that that means I have added another Hatif and that is you can see that as
a climate change profile picture.
Right.
So right now this portion is updated.
That means right now I have the picture.
If that means this user have some of the profile images for the reasons.
Are only these images visible.
Right.
You can see right now only these images is visible.
And before that was the default one.
So that means this user don't have any profile images, then URLs.
If the URL Syria, our default image, that means default user images visible.
And for the default image section, I have added another one in our DeSales area.
That is our change profile.
So now we have to do we have to update it.
Like right now, if this user wants to update their new image, then how can I get it right?
So before that was actually replaced by our default image.
Now we have to do we have to replace it by our D existing image.
That means this user existing image.
Right.
So if you want to do that work, then for doing this, we have to do we have to create another class
for this one.
So don't worry, step by step.
I will show you.
So for doing this.
First of all here, I want to do want to add another button.
That means right now we are in particular this condition that this user has on the profile image.
So here I want to do to take another like same better I copy it.
And that means after these are the main ones into the main one area, I passed it.
OK, so right now I don't display this very little.
I will add it.
So this will be also as the change profile picture, the step up one of the button, namely easily visible
here.
You can see there, there in between between info and then between s.m and now if you click the Savol
so and now if you refresh it.
Yeah.
Now this is visible our change profile picture.
So I want to do to put some of the bracket.
That means here, here I put some of the bracket and the bracket.
Now let's check this out again.
Please save all and refresh it.
Yeah, you can see that actually our change profile picture.
So right now I want to do I want to update our existing this user profile image.
So here we have to work.
So for doing this, I first of all, I want to do, in our view, into the viewing area.
I want to create another function.
So also shall be as a logging bigger because of all that's all that our logging user details.
Right.
That means logging user profile.
So I may meet one of the function name and I just made me the the change, Jane's profile, picture,
profile and picture.
So whatever you want right now, I make that as a change profile picture.
And first of all, it should be sending our request.
And also here we have to do we have to load our form.
That means our also you have to pass some of the form.
Right.
So because of all when this change profile will be selected, then it will dictate to some of the profile
picture.
So here from here, we have updated our existing profile image.
So for the regions here, take one of the variable.
The form and the form area will be the same.
Our profile profile picture.
That means that is our class.
We have already created that form.
So in the form we consider the killer profile picture.
Right.
So from here we have to access it.
So now I added our profile picture and into the profile picture area.
We have to do we have to add our intestines request because of.
All right.
Now for this user already updated.
One of them is friend.
Make sure you understand that part very clearly because of all before that happens on the default image.
So this user already updated that image.
So right now, already there have some of the existing image.
Right.
So for the reasons here, if one takes that existing image here, we have to do we have to make at the
instance in a sense that is actually existing this user all the detail.
So I want to access this user.
That means a logging user whose user is currently logging.
So if you.
It says that current user then the request that will be under our biggest user, right, and with this
request user, I want to do on Texas our listings.
I want to access our model into the model area that is our relation.
I put the name with our user profile.
Right.
Not that our user class did that user profile area.
I have already added our this profile.
So no, I don't want to access it with our user profile.
So this will be our user profile.
And after that I want to do I want to load one of the page.
So here also we have to do have to load on the page.
The better I copy it, it'll be just like the same and I just save it.
OK, so that means here it shall be saved.
That means, you know, return render request in our app logging.
That is our pro picture at this table.
I loaded our this as Tamalpais and then contest from here.
I passed out this form.
So for this I want to do want to create one of the what that means in our app logging and in that you
are still here.
I want to do want to create another one better copy paste if will be at the chain's picture.
I name it as a change and then picture.
OK, so that will be as a picture and it is a very I have created of the function, our function name
as a change for picture.
So now and we don't expect it to be the change per picture and I just name it as a Jamesburg picture.
OK, that means our but I added as a change picture to no one to do.
I want to put that our link.
That means this link.
I want to put the things in our particular this button.
So that is in our profile.
Now go to our profile e-mail and the profile is the same that things as a blancs right now on the ground
updated.
So that will be our Eurail and then our app blocking.
That means that is our app logging.
And then I have created our name as a transport picture.
So now I want to update our change picture.
Right.
So if you look at the Savol, so that means he should be reelected to our particular business function
into the functionality.
I have loaded our this space that Mr. Picture Address timbrell.
So now everything will be more clear to you into the instant.
Christiania, I have already used our current user profile that like if you're not looking to save all,
first of all, on the check that servers are very specifically running.
And now if you refresh it and now click on the change profile picture.
Yes, you can see friend now is visible.
Our this current user profile in this current user eye for this current is that I have already updated
one of the profile images.
That means that our profile image.
Right.
So for the reasons here, I have used that in a sense.
So with this instance, our current user that we switch user is already logged in and this current user
user profile I want to access.
OK, so for the reasons here, you can see if you click on here, there is our current user profile
image is visible and then they have another option for the changes.
So if you want to change it right now, we have to work for our change this image.
So for doing this, we have to do we have to work in our this view.
So that is our request and that is our farms.
Right.
So after this from here, I want to go on the board that our conditional conditional will be just like
that.
Same before.
I think you already remember what exactly you have to do if conditions are different here.
I have loaded that have rendered our same base.
So if you want to create another different space and into the different position to work, then you
can work it.
Right now you can see for this change, I loaded our pro picture add and also for this space that means
our change profile picture.
I added the same pace and also the consider the same pace from here.
I pass that as a form.
So for the reasons here, I also pass that as a form here.
I also pass that other from.
So if you want to change it, you can change that different template for specific this function.
Right.
So now it's OK with me.
So even if it will be same as a request and then method.
So first of all it be check that as a post or not.
So I have already discussed a lot of the time there is a pause and then our form.
So with this form right now, with our profile, that means our profile pic so that we our profile piece
right into the profile area here.
First of all, you have to pass that our request request will be as opposed, same as before.
And also from here, we have updated the images.
Right.
So if you updated that image, as you can see, we have to also use that our request files.
So now I also want to want to use that already case files.
And here what exactly the data I want to write, I here I want to override our existing DC mess here.
I want to replace it with our new image.
Right.
For the reasons here we have to do we have to reload our instant data.
That means this instance data.
Right.
So I just simply copy it.
And here.
After this, I loaded our instant current user, that current user, this profile I want to replace.
So that is or can you just request that the image?
I want to update it.
I put that things on here.
I hope it's very much clear to your friend.
And after that, that means year after that, we have to do that to get that validation.
That means that if if and then our phone if our phone I want to check that is valid, is valid.
First of all, we have to do we have to check it.
And then here I want to do to save our this from data and to save it.
So when it'll be saved after that, I don't want to pass on the return and the return return with the
CDC response response to that.
With this terrible response to that, I want to pass with the reverse.
So with this reverse, I want to pass two samples that I want to pass that thing through to our profile.
That means our profile page.
Right.
So here it should be just like the same suffering.
That's all we have to do.
So that's all we have to do.
I hope every line should be very much clear to you.
So here that is our pretending that that is right now when it's updated.
So redacted to our profile page right now.
Let's check this out.
If you click the save all, I could save all of us to fill to check it.
Everything is running well and now it should be the same as a pro here.
I have already loaded our form and the Crispi and they have those CSIR left and right.
And also here I have added that Insteps, because of all that, is the same.
I have already tested and we have already tested you for this add function.
Right?
So now we are actually doing the same things here only we have updated our existing current.
This picture I want to update.
So if you're not to refresh.
So right now into the profile area, there is this user already admitted that the following is an updated
the new image.
No, I want to change that again, the choosing file.
And right now I want to use this one.
OK, now open it, because the add picture.
Yes, you can see is perfectly now updated.
I hope friend is very clear to you.
So this user, when this user actually created an account by default, that would be some of the picture.
And then after this user, if you want to admit it, that image, then he can update this image.
Right.
So it's now perfectly working.
And from here, you want to change that profile details, you can change it.
But here one things.
What about the picture I have uploaded from here is what exactly is safe?
I have already declared that.
But that means you will be safe in our media into the media.
If we go to our model, into the model here you can see I have already uploaded to our profile picture
will be saved in particular this folder.
That means that is our media folder and there is a profile picture.
Right.
So now here you can see that is all the picture is visible.
So it is the profile picture.
They have the two picture I have uploaded.
So right now our two picture is uploaded.
Right.
So here I want to do when I want to change our new image, that means right now this picture already
have on here.
I show you like I want to change it.
I want to change it without this, of course, now OpenNet, because the picture now exists showing
our this picture.
But right now, if you go to our file, you can see there's a new picture is added as a Django course.
So here it should be.
Not like that way.
When our new image will be replaced with our old images, our old image should be deleted.
Right.
So if you want to do that work in Django, there have also one of the packets as a Django clean up.
So I want to do want to install it then with this we can actually do that work very easily.
So if you want to do that work, first of all, you have to do you have to go to your product directly,
that means that is a positive way.
And here we have to do we have to install one of the package as a beep, beep install and then that
Django G and go Django hype and then clean up and then clean up.
So if you as they enter, so make sure you install it, there is a beep.
Install Django clean up.
So right now here, this event is showing as a requirement already satisfied, so you have already installed
it for the resources training as required.
That means the equipment already satisfied, then you should be actually installed in your system.
OK, that means the installed can go clean up.
So that is actually the command line.
And after that, we have to do we have to work in our main project.
That means our main project and go to the setting so that, no, we don't need this.
I want to remove it and make the things a little clean.
OK, so now go to main project and go to the setting.
So here, here, here in our install the various intravenous toilet area here, we have to bit.
So here we have to.
So here you have to add that as a jingle jangle and then the underscore, then clean up, clean up dot
apps and then clean clean up config because you make sure you add that part.
OK, so that is all jango clean up apps and the clean up config.
So that should be added.
Now if you click the save also, that's all you have to do actually.
So here you can see right now our disk Django course is executed.
Right.
So that means this image is visible.
So that is our image.
So now to do to replace it.
Now what exactly will be happen?
I just click the refresh and change it.
So right now, to change it with our this one as a Laravel seven open, it looks like the add picture.
So now you can see it's not updated.
But right now, if you go to our site.
Yes.
Here you can see for now our previous one, that is actually the Django course on Django KOSDAQ being.
So now it's replaced with this one.
That means a lot of L7.
That means our previous one is totally gone from here.
Right.
So how much easily you can do that work with using that Django clean up, I hope is very much clear
to you.
So that is also the element of the package.
So first of all, you have to install it and also you have to add it in your setting.
Perfect, I hope is very much clear to your friend and in know.
Next video to discuss about that navigation bar.
How can working with this in our next video, I will show you that things with the live example.
So thanks for watching.
I'll see you in the next video.