Jus*_*ing 5 django django-templates django-rest-auth
我django-rest-auth在我的项目中使用,并且想要自定义重置密码时使用的电子邮件模板。如果我使用用户电子邮件发送 POST 请求,/rest-auth/password/reset/则该请求有效,但我收到的电子邮件是:
电子邮件:
from **webmaster@localhost** via ...
...
http://**example.com**/reset/ZGJjNjU2MjAtZjdjNy00MDdjLTkyZDctZDAwZGM2M2IzMmU4/4ys-09e6403c9784bea04986/
...
Run Code Online (Sandbox Code Playgroud)
基本上我希望域example是项目的域,并且发件人电子邮件是自定义电子邮件。
我看到我可以创建一个/templates/registration/password_reset_email.html文件并在那里进行更改。我需要更改的行是:
{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
Run Code Online (Sandbox Code Playgroud)