Reputation: 119
So in my navigation bar I have tried to add an icon. However, even with the correct path given (shown with fuji.png) the image gives a 404 (NOT FOUND).
The error message in inspect element is:
GET http://127.0.0.1:8000/icons/fuji.png 404 (Not Found)
Does this mean that instead of a relative path it looks for a URL path?
navbar.html
<div class="topnav">
<nav>
<div class="logo-image">
<img src="/icons/fuji.png" alt="Mt. Fuji"/>
</div>
{% with url_name=request.resolver_match.url_name %}
<a class="{% if url_name == 'index' %}wob{% endif %}" href="{% url 'polls:index' %}">Homepage</a>
<a class="{% if url_name == 'create' %}wob{% endif %}" href="{% url 'polls:create' %}">Create a Poll</a>
{% endwith %}
</nav>
</div>
*BY THE WAY:: I get the same response with /icons/fuji.pg and icons/fuji.png.
This is my directory (not everything, only showing what is necessary):
Does anyone have an idea of why this is happening and how to fix this? The image doesn't even load in -- it is just a broken image file.
Upvotes: 1
Views: 585