Using a favicon in Django

Sun, Nov 1, 2009

Tech Tips

The default location for a favicon.ico file is the root folder of website. However when using Django with an apache virtualhost, you need to map the location of your favicon.

Here are a few ways to get you favicon working:

1) The quick way is to modify the html in your base template to include the shortcut link. This assumes that you have already mapped a media folder called “media”:

<link REL="SHORTCUT ICON" HREF="/media/favicon.ico">

2) Probably the more proper way is to modify your httpd.conf file:

<LocationMatch "^/favicon.ico">
SetHandler default
</LocationMatch>
alias /favicon.ico /directory-to-icon/static/favicon.ico

How Can I Make a Favicon
Here is an online tool to quickly create a favicon, by uploading an image.

Bookmark and Share

Comments are closed.