Reputation: 53
my code is like that:
<body>
<a href = "{% url 'pacientes' %}">
<img src="/aaa.png"/>
</a>
</body>
my question is: Why does the image not load if the image and the html are in the same directory
obs.:
i already tried write the img tag out of the 'a' tag too. this html is part of a django project, idk if this really make difference
Upvotes: 0
Views: 59
Reputation: 5884
Load static
in your template
{% load static %}
<body>
<a href = "{% url 'pacientes' %}">
<img src="{% static 'my_app/aaa.png' %}"/>
</a>
</body>
See also: Configuring static files
Upvotes: 1