title: PDF output using Weasyprint not showing images (Django)
body: <p>I am trying to output PDF on Django using the Weasyprint library, but the images don't appear on the generated PDF. I have tried both relative and static URLs for the images, but even the static URL doesn't show the image. When opening the HTML itself on chrome, the images do show. </p>
  
  <p>Here is my pdf generation view in the views.py file:</p>
  
  <pre><code>def pdf_generation(request, some_slug)
      stud = Student.objects.get(some_slug=some_slug)
      studid = stud.some_slug
      context = {'studid':studid}
      html_string = render_to_string('templates/pdf_gen.html', context)
      html = HTML(string=html_string)
      pdf = html.write_pdf(stylesheets=[CSS(settings.STATIC_ROOT +  '/css/detail_pdf_gen.css')]);
      response = HttpResponse(pdf, content_type='application/pdf')
      response['Content-Disposition'] = 'inline; filename="mypdf.pdf"'
      return response
  </code></pre>
  
  <p>Here is the part of the HTML of the image:</p>
  
  <pre><code>&lt;DIV id="p1dimg1"&gt;
  &lt;IMG src="{% static 'img/image.jpg' %}" alt=""&gt;
  &lt;/DIV&gt;
  </code></pre>
  
  <p>And the CSS:</p>
  
  <pre><code>#page_1 #p1dimg1 {position:absolute;top:0px;left:0px;z-
  index:-1;width:792px;height:1111px;}
  #page_1 #p1dimg1 #p1img1 {width:792px;height:1111px;}
  </code></pre>
  
  <p>Thank you very much</p>