3

For some reason my favicon is not appearing on chrome. I am using django. And I have a file named favicon.ico in my static folder.

{% load static %}

<link rel="icon" href="{% static 'favicon.ico' %}"/>
Ivan Starostin
  • 8,798
  • 5
  • 21
  • 39
Jack
  • 460
  • 5
  • 16
  • Please show how you configured static files in settings.py, urls.py, clarify is Debug=true or false, what's the http response static when you try opening favicon url manually. – Ivan Starostin Apr 03 '21 at 14:02

3 Answers3

2

Add the image in static folder and make sure the image is an ico file

cluster
  • 56
  • 5
0

Hope this may help:

{% load static %}

<link rel="shortcut icon" href="{% static 'yourappname/images/favicon.png' type='image/ico' %}"/>

OR

You can store favicon as a png file too.

<link rel="shortcut icon" href="{% static 'yourappname/images/favicon.png' type='image/png' %}"/>

Additionally:

  • Store your icon in yourappname/static/yourappname/images/favicon.ico path
  • Make sure you have written <link rel... between the <head> tags in your template.
  • Don't forget to use {% load static %} tag in your template.

You can find more details about 'using favicon' from this question.

Dilshan
  • 120
  • 3
  • 9
0

You can try :

<link rel="shortcut icon" href="{% static 'players/images/liverpool.png' type='image/png' %}"/>
sasuke
  • 81
  • 3