2

I'm having a pretty absurd issue everywhere. Every new Django project I create is utilizing an old favicon that I made a long time ago. In other words, all new Django projects have this old favicon and I have no idea how or why it's accessing it.

Any ideas?

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129

2 Answers2

0

There are two points to consider:

How you access your sites under development

If you use a generic URL such as http://localhost, your browser considers all your sites to be the same one. Thus, you suffer from cross-site caching issues. If so, you can try the well-known solutions described in How to force a favicon refresh. An alternative solution is to use you hosts file (/etc/hosts on Linux or C:\Windows\System32\drivers\etc\hosts on Windows). Add lines such as:

127.0.0.1 myfirstsite.com
127.0.0.1 mysecondsite.com

Then, browse your sites under development just like a regular site with http://myfirstsite.com or http://mysecondsite.com.

Duplicated favicon(s)

Is there any chance your icons are duplicated?

  • Maybe you have duplicated declarations in your HTML. Some browsers may use the first one, some others the second one.
  • Maybe you have a duplicated favicon in your root directory (ie. http://example.com/favicon.ico). This is a convention, so some browsers may pick this one instead of the one you declared in the HTML.
Community
  • 1
  • 1
philippe_b
  • 38,730
  • 7
  • 57
  • 59
  • Thanks. I'll give them a shot. I deleted the Favicon folder in Chrome but that didn't seem to solve the issue. I did notice something weird though. When I go to Django's default server URL (http://127.0.0.1:8000/), I see the favicon. However, when I just go to localhost:8000, I DON'T see the favicon. Hopefully this will help me pinpoint the issue! – oakesonline Jul 19 '16 at 16:41
0

If favicon is still not shown on your browser by clearing browser's cache, then you should use different urls.

For example, you use the url below:

http://localhost:8000/...

python manage.py runserver 0.0.0.0:8000

Then, change localhost to 127.0.0.1 as shown below:

       ↓↓↓↓↓↓↓↓↓
http://127.0.0.1:8000/...

python manage.py runserver 0.0.0.0:8000

Or, change the port as shown below:

                 ↓↓↓↓
http://localhost:8001/...
                                   ↓↓↓↓
python manage.py runserver 0.0.0.0:8001
Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129