简体   繁体   中英

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">

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM