Angie
Angie

Reputation: 313

Django Forgot Password function changing default email

I created a Forgot Password functionality for my website using the password_reset function that is built in Django it sends an email like so:

You're receiving this e-mail because you requested a password reset for your user account at example.com.

Please go to the following page and choose a new password:

http://example.com/reset/3/2zf-fe162b1d79f1b85c3630/

Your username, in case you've forgotten: Angie

Thanks for using our site!

The example.com team

Where would I change this email?

Upvotes: 2

Views: 3383

Answers (2)

trd
trd

Reputation: 91

For those who get the error:

Caught NoReverseMatch while rendering: for line {% url 'views.cust_password_reset_confirm' uidb36=uid token=token %}

when trying to send the reset password email, watch out the password_reset_confirm url. It should be something like:

(r'^password-reset-confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$','django.contrib.auth.views.password_reset_confirm', {'template_name':'accounts/password_reset_confirm.html', 'post_reset_redirect':'/accounts/logout/'}),

Upvotes: 0

user3850
user3850

Reputation:

The default template for that email is django/contrib/admin/templates/registration/password_reset_email.html. You can override it by providing your own template templates/registration/password_reset_email.html in your top app directory as usual.

Upvotes: 6

Related Questions