【发布时间】:2011-08-16 14:37:42
【问题描述】:
根据Django的password_reset视图,它
允许用户重置密码 通过生成一次性使用链接 可用于重置密码,以及 将该链接发送到用户的 注册的电子邮件地址。
电子邮件由用户提供的模板生成。我找不到的是要在电子邮件模板中使用的 link 变量 的名称(它不是 {{ link }} :)
例如,在 django-registration 应用程序中,它是 {{ activation_key }}。
我什至在我的模板中运行了 {% debug %} 来查看所有变量,但没有什么明显的。另外,这是 Django 1.2,而不是开发版本。
更新:我的模板看起来像:
{{ protocol }}://localhost:8000{% url django.contrib.auth.views.password_reset_confirm uidb36=uid token=token %}
Click on the link (or copy/paste into your browser), and then you can change your password
并给我结果(在模拟电子邮件的文本文件中):
http://localhost:8000/accounts/password/reset/confirm/12-2ws-1c60be00955ea4=
a7a62e/
Click on the link (or copy/paste into your browser), and then you can chang=
e your password
【问题讨论】: