Django模板错误: Could not parse the remainder: ',' from 'uid,' ?

标签 django forgot-password django-errors

我正在使用带有自定义模板的 Django forgot_password 框架。我正在使用 Django 1.5。我的自定义模板 password_reset_email.html 如下所示:

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

最佳答案

将其放在顶部:

 {% load i18n %}{% load url from future %}
 {% autoescape off %}
 ..........

删除,,将其放在uidb36=uid,旁边

 {% url 'django.contrib.auth.views.password_reset_confirm' uidb36=uid token=token %}

关于Django模板错误: Could not parse the remainder: ',' from 'uid,' ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15654472/

相关文章:

python - 如何将多对多关系转换为查询集?

security - 我应该通过 Twitter 上的直接消息向用户提供丢失的凭据吗?

php - 我有md5加密的密码,当他使用 "Forgot password"时如何将密码提供给用户?

django - 如何使用 Gunicorn 查看 Django 错误的详细信息?

Django向Form传递参数,得到KeyError

您自己的用户模型的 Django 每个对象权限

python - 获取不到一个月的所有元素

django - DRF : static/read-only/non-model fields in serializers?

php - 暴力保护实践密码重置

django - Django日志: Change sender email address from root@localhost to something else