Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get a favicon to show up in my django app?

Tags:

favicon

django

I just want to drop the favicon.ico in my staticfiles directory and then have it show up in my app.

How can I accomplish this?

I have placed the favicon.ico file in my staticfiles directory, but it doesn't show up and I see this in my log:

127.0.0.1 - - [21/Feb/2014 10:10:53] "GET /favicon.ico HTTP/1.1" 404 - 

If I go to http://localhost:8000/static/favicon.ico, I can see the favicon.

like image 313
tadasajon Avatar asked Feb 21 '14 15:02

tadasajon


People also ask

How do I get a favicon to show?

If you only want one favicon for your entire domain, simply save the favicon. ico file to the root folder of your site. When uploaded, it must be accessible from http://www.yourdomain.com/favicon.ico . As soon as you upload the file, your browser should start displaying the icon for all pages on your site.

Why is my favicon not showing up?

When you add a favicon to your site, it may not show up since your browser has 'saved' your site as one without a favicon. You need to clear the cache in your browser or use a different browser.

How do I add a favicon to my web app?

Adding it is easy. Just add an . ico image file that is either 16x16 pixels or 32x32 pixels. Then, in the web pages, add <link rel="shortcut icon" href="favicon.

How do I get a URL for my favicon?

To add a favicon to your website, either save your favicon image to the root directory of your webserver, or create a folder in the root directory called images, and save your favicon image in this folder. A common name for a favicon image is "favicon.ico".


1 Answers

If you have a base or header template that's included everywhere why not include the favicon there with basic HTML?

<link rel="shortcut icon" type="image/png" href="{% static 'favicon.ico' %}"/> 
like image 111
hanleyhansen Avatar answered Nov 03 '22 03:11

hanleyhansen