【发布时间】:2020-09-18 23:33:37
【问题描述】:
我正在尝试使用一些 html 标签覆盖默认 password_reset_email.html 的内容,但它不起作用。这是我的修改。出于测试目的,我只是使用 p 标签。但我不工作。我完全不知道出了什么问题。
这是我的过程。
urls.py
path('accounts/', include('django.contrib.auth.urls')),
这是我的 html 模板
{% load i18n %}
{% autoescape on %}
{% blocktrans %}You're receiving this email because you requested a password reset for your user account at
{{ site_name }}.{% endblocktrans %}
{% trans "Please go to the following page and choose a new password:" %}
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
{% endblock %}
<p>Hello world</p>
{% trans 'Your username, in case you’ve forgotten:' %} {{ user.get_username }}
{% trans "Thanks for using our site!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endautoescape %}
这是输出
【问题讨论】:
-
您是否将其设置为电子邮件 html?还是原始文本?
-
我是否需要更改其他内容,因为我使用的是 django 提供的默认 html 模板,该模板位于注册文件夹中。
-
您可以显示您提交电子邮件的视图吗?
-
这里我使用的是 django 提供的默认身份验证,
django.contrib.auth.urls -
请edit您的问题。
标签: django