Alex Rivera | Logout

Django password reset email subject

Asked 2011-12-10T13:11:10.263
9

I have successfully added my own custom HTML templates for the password reset pages in Django and it's all working nicely. The only bit I can't work out it how to include my own email subject.

The default is "Password reset on [my site name]" and I can obviously change the site name in admin but does anyone know how to override the whole subject line?

Thanks.

Edit
Report

1 Answer

0

The PasswordResetForm sends the email based on your contrib.sites. It gets the domain name to use and passes it to the html template at registration/password_reset_email.html

use admin or django shell to change the site

in shell you can do this by doing:

>>> from django.contrib.sites.models import Site
>>> my_site = Site(domain='your_domain.com', name='Your Domain')
>>> my_site.save()
>>> print my_site.id
2
>>>

in your settings.py:

SITE_ID = 2
answered 2011-12-10T13:19:18.173

Your Answer