【发布时间】:2020-07-30 07:49:31
【问题描述】:
我已将我的 Django 项目部署在生产环境中,并使用 Django 身份验证重置密码
我收到一封带有链接的电子邮件,但我收到消息“无效令牌”,这意味着该链接无效
Settings.py
ALLOWED_HOSTS = ['192.xxx.xx.xx','http://example.com/','https://example.com/'] #example.com replace by my real domain
CSRF_COOKIE_SECURE = True
CSRF_TRUSTED_ORIGINS = ['example.com']
password_reset_email.html
Une demande de modification de mot de passe a été demandé par {{ email }}.
Veuillez suivre ce lien :
{{ protocol}}://example.com{% url 'password_reset_confirm' uidb64=uid token=token %}
PS : Merci de ne pas répondre à cet email
【问题讨论】:
标签: django authentication