Adarsh Pandey
Adarsh Pandey

Reputation: 73

Django static image not loading on setting debug=False

How do I load images in debug=False for testing purposes? Below is my code for your reference.

<img src="/static/b_icon.png" alt="Brand Icon" width="30" height="30" class="d-inline-block align-text-top">

Upvotes: 1

Views: 362

Answers (1)

dani herrera
dani herrera

Reputation: 51655

This is wrong:

<img src="/static/b_icon.png" 

This is right:

{% load static %}

<img src="{% static 'b_icon.png' %}

Just take a moment to read carefully Managing static files, Serving static files during development docs and follow all steps.

Upvotes: 1

Related Questions