【问题标题】:how to change the Django password reset email style and content如何更改 Django 密码重置电子邮件的样式和内容
【发布时间】:2021-06-04 04:43:59
【问题描述】:

所以我使用的是内置的 Django 密码重置系统。它工作正常,但我对发送给用户的电子邮件不满意。我想改变所有这些,从样式到文本。但我该怎么做呢?我在这里阅读了一些解决方案,但它们比有用更令人困惑。

【问题讨论】:

标签: django


【解决方案1】:

您可以在此处编辑现有电子邮件:<projectName>/lib/python/site-packages/django/contrib/admin/templates/registration/password_reset_email.html

或者您可以创建一个名为 registration 的新文件夹并将模板添加到其中以创建您自己的:

password_reset_form.html
password_reset_subject.txt
password_reset_email.html
password_reset_done.html
password_reset_confirm.html
password_reset_complete.html

然后将所有身份验证视图包含到您的项目网址中:

urlpatterns = [
    url('^', include('django.contrib.auth.urls')),
]

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2021-06-04
  • 2016-04-26
  • 2012-05-16
  • 1970-01-01
  • 2017-01-25
  • 2020-02-15
  • 2021-02-07
  • 1970-01-01
相关资源
最近更新 更多