I am using the Django native password reset functionality to reset account passwords.
urls.py
path('reset/', auth_views.PasswordResetView.as_view(template_name='account/password_reset.html',
form_class=PasswordResetform), name='reset'),
path('reset_done/', auth_views.PasswordResetDoneView.as_view(template_name='account/reset_done.html'),
name='password_reset_done'),
path("reset/<uidb64>/<token>/",
auth_views.PasswordResetConfirmView.as_view(template_name='account/reset_confirm.html',
form_class=PasswordResetConfirm), name='password_reset_confirm'),
path("reset/complete", auth_views.PasswordResetCompleteView.as_view(template_name='account/reset_complete.html'),
name='password_reset_complete'),
now everything works fine, I get the password reset link in my email and when I open it I am able to reset my password, but after the user resets the password, I want to send them an email saying their password has been reset
I tried to write an ajax function that is triggered when it goes to the 'password_reset_complete' template, but there I am unable to access the user's email or username. how do i retrieve the user's email or username in the 3rd or the 4th template of the password reset steps?
PasswordResetCompleteView
to extend it so that you can send emails to user upon successful password reset – Muteshi