tags:

views:

29

answers:

1

Hi guys!

I found this solution for serving favicon.ico with django.

(r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': settings.MEDIA_URL+'images/favicon.ico'}),

I do not understand why it only works for the development server. Going to /favicon.ico works on dev, doesn't with debug=False It should redirect to /media/images/favicon.ico (served by apache), which does work if you access it directly.

Any ideas? Thanks!

+3  A: 

I'd recommend against serving the favicon with django unless you absolutely have to. Instead, putting a setting in your web server config that adds an alias pointing to the favicon.

For example, in apache:

Alias /favicon.ico /path/to/media_url/images/favicon.ico
Jordan Reiter
Agreed. Just went to my shared hosting, got it to work putting an exception for lighttpd (I thought it was apache serving the stuff)
Clash