I have a list of users in a ListView
CBV and want to add a "reset password" link that will send an email with a reset password token to that user with one click (as the auth_views
are currently set up to after you submit a request via a form).
For example:
<td>{{ user.email }}</td>
<td><a href="{% url 'reset_link' user.pk %}">Reset password</a></td>
I am using the CBV auth_views
so know I could reset this user's password manually via redirecting to a form and using Django's inbuilt auth_views.PasswordResetView
. However as I already have the user.pk
I just want a link that instantly sends the relevant email.
Is there a way to send the email using user.pk
via a single link if I already know the pk
?