【发布时间】:2018-08-09 01:59:38
【问题描述】:
我正在尝试使用 html 模板覆盖默认电子邮件以在 Django rest-auth 中重置密码。
我正在尝试使用:
from django.conf.urls import url
from django.contrib.auth import views as auth_views
urlpatterns = [
url(r'^password/reset/', auth_views.password_reset,
{
'html_email_template_name':'registration/password_reset_email_html.html',
},
name="password_reset"),
url('^', include('django.contrib.auth.urls')),
]
电子邮件已成功发送,但使用默认模板。
我可以通过添加自定义模板文件registration/password_reset_email.html 来覆盖它,但随后电子邮件仅以纯文本形式发送。
我在这里做错了什么?
【问题讨论】:
标签: django django-registration django-rest-auth