Reputation: 1061
So I am building a website with Django, and on the homepage I want to render an image that is always the same. Here is what I have tried. The pictures and the html file are in the same directory.
This is the html:
<div class="ui segment">
<div class="ui horizontal divider">
View the results
</div>
<img src="3.png" alt="View Results">
</div>
And this is a picture of my folder:
The image isn't showing up at all, I just get that small icon that you get when the image doesn't load.
Any help would be appreciated!
Upvotes: 1
Views: 73
Reputation: 600041
You don't put images in the templates directory. You put them in the static directory and refer to them via the {% static %}
tag.
See the tutorial on static files.
Upvotes: 2