如何为django-registration-redux密码重置制作自定义电子邮件模板?

时间:2016-02-26 08:49:41

标签: python django

正如问题所说,我正在使用django-registration-redux并且我已经为注册电子邮件和页面制作了模板,但无法弄清楚如何为重置密码制作模板电子邮件。 我使用的是django 1.9

2 个答案:

答案 0 :(得分:3)

根据itzmeontv的回答:

覆盖registration应用程序中的原始模板。

  • 在基础应用中创建文件夹templates(如果不存在)
  • 在其中创建文件夹registration。所以文件夹看起来像<yourapp>/templates/registration
  • yourapp/templates/registration内,创建与registration app中名称相同的htmls。例如:password_change_form.html。所以它看起来像<yourapp>/templates/registration/password_change_form.html

确保您的基础应用程序位于registration中的INSTALLED_APPS之前。

答案 1 :(得分:2)

覆盖registration应用程序中的原始模板。

  • 创建一个django应用registration
  • templates
  • 中创建文件夹registration
  • 在其中创建文件夹registration。所以文件夹看起来像registration/templates/registration
  • registration/templates/registration内,创建与registration app中名称相同的htmls。例如:password_change_form.html。所以它看起来像registration/templates/registration/password_change_form.html。然后检查
    https://github.com/macropin/django-registration/blob/master/registration/templates/registration/password_change_form.html并将粘贴复制到password_change_form.html。现在就做你想做的事。

希望这有帮助。