18👍
✅
That happens because Django does not know the path to this image.
Make a folder named static/
, and then a folder named images/
in your project root(where your settings.py file resides).
my_project/
my_project/
settings.py
static/
images/
google.png
And then change it to:
<img src="{{STATIC_URL}}images/google.png" / >
More here.
- Error loading MySQLdb module: libmysqlclient.so.20: cannot open shared object file: No such file or directory
- Google App Engine Application Extremely slow
10👍
You have got to add load static tag in the beginning of your Django template, best luck with below code.
{% load static %}
<img src="{% static 'path/to/image.ext' %}"/>
Source:stackexchange.com