擅长:python、mysql、java
<p>将图像路径的静态设置为:</p>
<pre><code>{% load static %}
<img src="{% static 'images/your_image.png %}" alt="" />
</code></pre>
<p>然后,必须将Weasyprint的HTML类中的基url传递为:</p>
<pre><code>HTML(string=html_string, base_url=request.build_absolute_uri())
</code></pre>