Search code examples
djangoforgot-passworddjango-errors

Django Template Error: Could not parse the remainder: ',' from 'uid,'?


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,'

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