Dicovering the issue in profile image update
In this video, we are going to disuss a issue that you can face while updating the profile image.
Resources
Code Setup
-
First of all, you need to download the project code files the resources section: DOWNLOAD ZIP FILE
-
Now, extract the folder on the desktop.
-
Then, copy the mysite folder which is the project root directory.
-
Replace the mysite folder of your project with the copied mysite folder. So, if you made any mistake while writing the code in the previous section, then, it won't affect your learning in this section.
-
Open your project in the VS code and in the terminal, activate the virtual environment, and move to the mysite.
-
Run the migrations and create a superuser.
Discovering the issue
Now, open your profile-view.html and update the links for profile update and change-password.
<div class="col-12">
<button class="btn btn-sm btn-success m-1">
<a href="{% url 'accounts:profile-update' %}"><i class="fas fa-pen"></i> Update Profile</a>
</button>
<button class="btn btn-sm btn-danger m-1">
<a href="{% url 'accounts:change-password' %}"><i class="fas fa-pen"></i> Change Password</a>
</button>
</div>
[Explain the Issue]
Add a profile image.
Change the profile image.
Old Image doesn't gets deleted.
- To fix this issue, we are going to use signals in django. So, in the next video, we will learn about the fundamental concepts of signals in django.