I am using Django forgot_password
framework with custom template. I am using Django 1.5
. My custom template password_reset_email.html
looks like this:
{% autoescape off %}
You're receiving this e-mail because you requested a password reset for your user account at {{ site_name }}.
Please go to the following page and choose a new password:
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url django.contrib.auth.views.password_reset_confirm uidb36=uid, token=token %}
{% endblock %}
Your username, in case you've forgotten: {{ user.username }}
Thanks for using our site!
The {{ site_name }} team.
{% endautoescape %}
#Exception:
Exception Type: TemplateSyntaxError at /accounts/password/reset/
Exception Value: Could not parse the remainder: ',' from 'uid,'
Put this in the top:
{% load i18n %}{% load url from future %}
{% autoescape off %}
..........
Remove ,
, you put it beside uidb36=uid,
{% url 'django.contrib.auth.views.password_reset_confirm' uidb36=uid token=token %}
I don't have enough reputation points to comment on the accepted answer, but the {% load url from future %} shouldn't be required since you're using Django 1.5. It was only needed in Django 1.3 and 1.4. https://docs.djangoproject.com/en/dev/releases/1.3/#changes-to-url-and-ssi
As of 2022 (django version 4.0.5), none of the answers here worked for me. I had to change the line:
{% url django.contrib.auth.views.password_reset_confirm uidb36=uid, token=token %}
to:
{% url 'password_reset_confirm' uid token %}
where password_reset_confirm
is the name
that I have given to the password reset confirm view in my url pattern, which is located in the urls.py
file insde the app where I am managing my user registration system (the app is called users
):
path('pattern/<uidb64>/<token>', django.contrib.auth.PasswordResetConfirmView.as_view(template_name='users/password_reset_confirm.html'), name='password_reset_confirm')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With