1👍
You will need all urls for built-in password reset:
from django.contrib.auth.views import password_reset, password_reset_confirm, password_reset_complete
url(r'^password/reset/done/$', custom.password_reset_done, name='password-reset-done'),
url(r'^password/reset/complete/$', password_reset_complete, {'template_name': <template>}, name='password_reset_complete'),
url(r'^password/reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', password_reset_confirm, {'template_name': <template>}, name='password_reset_confirm'),
url(r'^password/reset/$', password_reset, {'template_name': <template>, 'email_template_name': <template>, 'post_reset_redirect': 'password-reset-done'}, name='password-reset')
The only custom here will be custom.password_reset_done
, just write your own view instead:
def password_reset_done(request):
"""Page after password reset."""
return render(request, '<template path>', {})
In such cases using IDE to explore source code of these views helps a lot for defined required variables and etc.
Source:stackexchange.com