I have the following architecture:
Project/
templates/
aaa/ #This is my application main templates folder
registration/
password_reset_complete.html
password_reset_form.html
password_reset_email.html
password_reset_confirm.html
aaa/
I would like to move password_reset
templates files and destroy the registration
folder to get the following architecture:
Project/
templates/
aaa/ #This is my application main templates folder
password_reset_complete.html
password_reset_form.html
password_reset_confirm.html
mails/
password_reset_email.html
aaa/
I guess I can override password_reset_complete
, password_reset_form
, password_reset_confirm
url patterns, but how to do for the password_reset_email
template?
Indeed you can change the template_name
argument passed to each django.contrib.auth
views. The password_reset
view has several templates filename passed in parameter that you can customize.
According to the Django source code, it should be something like this, in your URL patterns:
(r'^accounts/reset_password/$',
'django.contrib.auth.views.password_reset',
{'template_name': 'aaa/password_reset_form.html',
'email_template_name': 'mails/password_reset_email.html'}),
(r'^accounts/reset_confirm/$',
'django.contrib.auth.views.password_reset_confirm',
{'template_name': 'aaa/password_reset_confirm.html'}),
(r'^accounts/reset_complete/$',
'django.contrib.auth.views.password_reset_complete',
{'template_name': 'aaa/password_reset_complete.html'}),