PasswordResetView, html_email_template_name isn't updating


class ResetPasswordView(SuccessMessageMixin, PasswordResetView):
    template_name = 'accounts/reset_password.html'
    html_email_template_name = 'accounts/password_reset_email.html'
    success_message = 'Instructions to reset your password will be sent to the email you provided. Thank you.'
    success_url = reverse_lazy('accounts:profile')

html email template:

You're receiving this email because you requested a password reset for your user account at {{ site_name }}.

Please go to the following page and choose a new password:
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url 'accounts:password_reset_confirm' uidb64=uid token=token %}
{% endblock %}

Your username, in case you’ve forgotten: {{ user.get_username }}

The {{ site_name }} team.


urlpatterns = [
    path('update-password/', UpdatePasswordView.as_view(), name='update_password'),
    path('reset-password/', ResetPasswordView.as_view(), name='reset_password'),

Despite setting a template path for the email, Django continues to load the default instead: \lib\site-packages\django\contrib\admin\templates\registration\password_reset_email.html

Why is it not using accounts/password_reset_email.html?

Back to Top