Solution 1 :

I like to use:

They let you upload an image to use and it will output a directory with all scaled versions of the image for all manner of devices your page could be viewed on including the html that you will need to copy and paste.

Solution 2 :

Fairly sure the syntax for the href should be: href=”{% static ‘imgs/favicon.ico’ %}

Solution 3 :

Best way to have a favicon on every page on your site is to link it to the base.html with href="{% static 'articles/favicon.ico' %}. Mind that you need to put {% load static %} in the template too.

Solution 4 :

Code standard favicon links at the top of your template or base.html and make sure the icons are there in the directory/s :

{% load staticfiles %}

  <link rel="shortcut icon" href="{% static "img/favicon.ico" %}">
  <link rel="icon" href="{% static "img/animated_favicon1.gif" %}">

You can use to create new favicons.

Problem :

I know this is a duplicate question, but I was trying to add a favicon.ico file to my site on localhost:8000 made with Django. The favicon exists on templatesarticles (in an app called articles), and I’ve tried everything on stackoverflow, youtube, and used, but nothing works. Do I have to define the Django URL/view for the ICO file, as localhost:8000/favicon.ico brings up error? Here’s my (simplified) code by the way:

<title>Newsreed | Articles</title>
<link rel="shortcut icon" type = 'image/x-icon' href="favicon.ico">

What should I do, because I’ve been struggling with it for several days now and tere has been no solution on anything.


Comment posted by Raja Simon

You don’t have to create

Comment posted by Dr. Hippo

Still no progress… Current code:

Comment posted by Raja Simon

I can help you with that. First are you sure you’ve the favicon.png in your articles folder? What error you receive in your chrome console ?

Comment posted by Dr. Hippo

I made the static folder and did the changes. The image came up fine with img tag but still no progress with the actual icon