【问题标题】:Custom "html_email_template_name" not working自定义“html_email_template_name”不起作用
【发布时间】:2020-05-21 16:36:17
【问题描述】:

我正在尝试自定义应用程序发送的密码重置电子邮件,但没有成功。我的应用程序忽略了我的声明并继续发送此声明:django/contrib/admin/templates/registration/password_reset_email.html。

这是我相关的 url.py 声明:

# Password reset
path('password_reset/', auth_views.PasswordResetView.as_view(template_name = 'account/password_reset_form.html', html_email_template_name='account/password_reset_email.html', success_url = reverse_lazy('account:password_reset_done')), name = 'password_reset'),

文件templates/account/password_reset_email.html存在且有内容。

非常感谢,我要疯了。

【问题讨论】:

    标签: django


    【解决方案1】:

    你使用了错误的视图变量

    email_template_name
    

    关于 PasswordResetView 的 Django 文档

    【讨论】:

      猜你喜欢
      • 2012-05-05
      • 2019-11-13
      • 1970-01-01
      • 1970-01-01
      • 2013-10-03
      • 2023-03-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多