Search code examples
djangofavicon

Django Favicon issue


what ever i try to do i can't get the favicon to show up, when i look it up in the view source tab it loads up but won't appear in the tab icon position.

i'm importing it in the html like so:

{% load static %}
<link rel="stylesheet" href="{% static "css/index.css" %}"/>
<link rel="Favicon" type="image/png" href="{% static 'images/icon.png' %}"/>

i set the django staticfile_dirs like so:

STATICFILES_DIRS = [
    os.path.join('static'),
    os.path.join('static/images'),
    ]

Solution

  • Try .ico format instead of .png format and rel="shortcut icon" or rel="icon"