如何使用django allauth在电子邮件中添加图像

时间:2019-07-11 09:09:02

标签: python django

我在使用django allauth时遇到麻烦 这是我的模板

password_reset_key_message.txt

{% autoescape off %}
{% load static from staticfiles %}
{% load i18n %}Hello{% if username %}, {{ username }}{% endif %}!

{% if username %}{% blocktrans %}In case you forgot, your username is {{ username }}.{% endblocktrans %}{% endif %}
You're receiving this e-mail because you or someone else has requested a password for your user account.
It can be safely ignored if you did not request a password reset. Click the link below to reset your password.

{% load static %}
<img src="{% static "avatar.jpg" %}" alt="avatar" />

{{ password_reset_url }}

{% if username %}{% blocktrans %}In case you forgot, your username is {{ username }}.{% endblocktrans %}

{% endif %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Thank you for using {{ site_name }}!
{{ site_domain }}{% endblocktrans %}
{% endautoescape %}

我正在尝试在电子邮件正文中添加图片(已经尝试使用源链接并将图片转换为base64),但结果相同

但是当我单击reset_email时,我得到了以下结果: enter image description here

0 个答案:

没有答案