title: django failed to load static image
body: <p>I have my django app hosted on pythonanywhere. I am using weasyprint to generate a pdf and there is an image to be shown in my pdf. The error in the error log is "Failed to load image at /static/images/logo.png". When I try to open the same path as url, it shows me the image in the browser. Which means it is getting the path right but something else is wrong.</p>
  
  <p>I have my static directory placed outside the app. And this path is added to the settings file.</p>
  
  <p>My folder structure:</p>
  
  <pre><code>     my_app
       static
          |__ css
          |__ images
                |__ logo.png
          |__ js
       templates
          |__ my_app
                |__ pdf.html
  </code></pre>
  
  <p>settings.py:</p>
  
  <pre><code>STATIC_DIR = os.path.join(BASE_DIR, 'static')
  STATIC_URL = '/static/'
  STATICFILES_DIRS =[
      STATIC_DIR,
  ]
  </code></pre>
  
  <p>pdf.html:</p>
  
  <pre><code>{% load static %}
  &lt;td&gt;&lt;img class="my_logo" src="{% static 'images/logo.png' %}" alt="Temporarily Unavailable"&gt;&lt;/td&gt;
  </code></pre>