I am implementing Password reset by using django Rest Auth, two thing I requires when request hits from reactjs frontend I want the email to be customize I want to use password_reset_email.html template.Firstly I used simple PasswordResetView and I got the email but it sends me to native Rest UI PasswordConfirmView.
I want,when User hit request it should use my templates which are, password_reset.html,password_reset_confirm.html,password_reset_done.html... which we make in our templates/appname directory my try:
urls.py:
urlpatterns=[
url(
r'^rest-auth/password/reset/$',
PasswordResetView.as_view(),
name='password_reset',
),
url(
r'^rest-auth/password/reset/confirm/'
r'(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
PasswordResetConfirmView.as_view(),
name='password_reset_confirm'),
]
authsystem/templates:
password_reset_confirm.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
{% if validlink %}
<h3>Change password</h3>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Change password</button>
</form>
{% else %}
<p>
The password reset link was invalid, possibly because it has already been used.
Please request a new password reset.
</p>
{% endif %}
</body>
</html>
I know the above approach is less but I want the direction how can I make it work I don't want to use rest auth built-in UI, when request hits from react side,How can I use templates when the email is sent,when I click on link in email I want to show my template, token and uid should pass from templates,I have all the templates ready but don't know how to use with Django Rest Auth.
url(r'^account/', include('allauth.urls')),
in your main urls). Just override the template used by allauth by putting the template inside an account directory inside your templates directory. Also I think the template name is incorrect, it should be authsystem/templates/account/password_reset_from_key.html – dirkgroten