Handling Password Reset Emails
Handling Password Reset Emails. As seen previously, each password reset email sent by Django contains a link that can be used to reset the password. To handle that link correctly, Django needs two more templates:
password_reset_confirm to display the actual password reset form and
password_reset_complete to show a confirmation that a password was reset.
01:34 If you now follow the password reset link from one of the emails, you should see a form similar to the one seen on-screen. You can now check if it works. Insert a new password into the form, click Confirm, log out, and log in using that new password.
You can change the default templates for Django emails just like any other user management related templates.
password_reset_email determines the body of the email, and
password_reset_subject determines the subject of the email.
02:44 You can also change the subject to something more descriptive by altering the file seen on-screen. If you implement these changes and send a password reset email again, then you should see this reflected in a terminal showing the email content.
03:08 As you can see, both the subject and content of the email have changed. Now that you have the features set up to allow users to manage their own passwords, in the next section, you’ll take a look at how to set your site up to allow users to register.
Become a Member to join the conversation.