title: Render image in template.html with Jinja2 and weasyprint in a PDF
body: <p>I have a python file that generates an HTML page (and a PDF) using jinja2 like this.</p>
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  import requests
  from jinja2 import Environment, FileSystemLoader
  from weasyprint import HTML
  
  # Stuff to get dataframe...
  
  # Generate PDF and csv
  env = Environment(loader=FileSystemLoader('.'))
  template = env.get_template(&quot;template.html&quot;)
  
  template_vars = {&quot;title&quot; : &quot;Something...&quot;,
                  &quot;vulnerabilities_table&quot;: df.to_html(index=False)}
  
  html_out = template.render(template_vars)
  HTML(string=html_out).write_pdf(&quot;report_styled.pdf&quot;, stylesheets=[&quot;style.css&quot;])
  </code></pre>
  <p>It uses the following <code>template.html</code></p>
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  {% block layout_style %}
  &lt;style&gt; @page { size: letter landscape; margin: 2cm; } &lt;/style&gt;
  
  {% endblock %}
  &lt;html&gt;
  &lt;head lang=&quot;en&quot;&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;title&gt;{{ title }}&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;img src=&quot;static/images/Logo.png&quot; style=&quot;height: 100; width: 300; float:inline-start&quot;&gt;
      &lt;h2&gt;{{ title }}&lt;/h2&gt;
       {{ vulnerabilities_table }}
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>The problem is that the image is not rendering at all (but the rest does). I guess it's because I'm not using Flask</p>
  <pre class="lang-html prettyprint-override"><code>&lt;img src=&quot;static/images/Logo.png&quot; style=&quot;height: 100; width: 300; float:inline-start&quot;&gt;
  </code></pre>
  <p>My image is in the folder static/images/Logo.png. What did I do wrong ?</p>