Question

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,'
Was it helpful?

Solution

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 %}

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top