I had a little trouble today trying to get a favicon for my django site. I found some solutions online, but they assumed that you were serving your media statically through your apache server. I’m serving all my static files through Amazon S3, so those techniques didn’t work for me. Here’s how I did it instead.
First, I copied my favicon.ico to my S3 bucket. It’s just a 16×16 png file that I renamed.
In my settings file I made sure the MEDIA_URL was set to my S3 URL.
Then I made sure these things were imported in my urls.py
from django.conf import settings from django.views.generic.simple import redirect_to
Lastly, I added this rule to my urls.py
(r'^favicon.ico$', redirect_to, {'url':settings.MEDIA_URL+'favicon.ico'}),
That’s it!
great, here’s the new way to do this: http://stackoverflow.com/questions/11428427/no-module-named-simple-error-in-django