Favicon HttpRequest failing (templating issue)

63 views
Skip to first unread message

benp

unread,
Sep 22, 2011, 10:35:02 AM9/22/11
to django-rest-framework
Hi,

When I try to view our API in the browser, there is a failed lookup of
the favicon resource. This doesn't happen using cURL, so it seems to
be related to rendering the template (or a browser issue).

Does the browser automatically look for a favicon if none is present
in the markup?

I looked through the restframework project and I couldn't find
references to favicon.ico in the template. I did find a view and url
pattern relating to favicon.

Any thoughts?

Best,
Ben

Tom Christie

unread,
Sep 22, 2011, 11:12:43 AM9/22/11
to django-res...@googlegroups.com
Hey Ben,

  Yup browsers will make those favicon requests regardless. 

  
As you mentioned rest-framework does have a favicon view wired up in it's urlconf.
You can see it on the tab of the sandbox... http://api.django-rest-framework.org/
It's only turned on if you're not in DEBUG mode, because unless you properly handle making sure they don't get cached by the browser, it'll end up being your icon pretty much all the time when your working from '127.0.0.1:8000', which is kinda annoying.

I probably ought to just ditch the favicon anyway, it's a bit out-of-scope really.

benp

unread,
Sep 22, 2011, 12:01:24 PM9/22/11
to django-rest-framework
Hey Tom,

Thanks for the quick reply. I've gone ahead and added a favicon to
the renderer template to make things work.

We wanted branding consistency on the site anyway.

Cheers,
Ben

On Sep 22, 11:12 am, Tom Christie <christie....@gmail.com> wrote:
> Hey Ben,
>
>   Yup browsers will make those favicon requests regardless.
>
> (Eg see here:http://stackoverflow.com/questions/1321878/how-to-prevent-favicon-ico...)
>
> As you mentioned rest-framework does have a favicon view wired up in it's
> urlconf.
> You can see it on the tab of the sandbox...http://api.django-rest-framework.org/
Reply all
Reply to author
Forward
0 new messages