Django重置密码:无效令牌

Django重置密码:无效令牌,django,authentication,Django,Authentication,我已经在生产环境中部署了Django项目,并使用Django身份验证测试密码重置 我收到一封带有链接的电子邮件,但收到的消息是“无效令牌”,表示链接无效 设置.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 =

我已经在生产环境中部署了Django项目,并使用Django身份验证测试密码重置

我收到一封带有链接的电子邮件,但收到的消息是“无效令牌”,表示链接无效

设置.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']

密码\u重置\u 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

如果您使用的是
CSRF\u COOKIE\u SECURE=True
,则您的URL必须为https格式

你可以阅读更多关于它的内容