Monday, June 9, 2008

Favicon with gae

While creating any new web application the one thing which I look at the most is the logs. The logs tend to give me a good idea of what is happening and in my case what I am doing wrong.

One error message which I am getting a lot of is;
INFO 2008-06-09 17:14:37,313 dev_appserver.py] "GET /favicon.ico HTTP/1.1" 404 -

This means a favicon is missing. So I went to the google application website and picked up the favicon and dumped it in my application directory.
http://appengine.google.com/favicon.ico

I also needed to add to the file app.yaml.
- url: /favicon.ico
static_files: static/images/favicon.ico
upload: static/images/favicon.ico

This option allows any images to be automatically shown without having to be processed any further.

A problem which I have found by doing this is the mime_type really needs to be set to something else, but it doesn't seem to work.

You will need to ensure that this statement is placed before others that my overwrite it, so check the order in the yaml file

More about this can be read here;
http://code.google.com/appengine/docs/configuringanapp.html

1 comment:

Blog Block Black said...

here is my yaml--

handlers:
- url: /favicon.ico
static_files: images/favicon.ico
upload: images/favicon.ico
mime_type: image

- url: .*
script: guestbook.py

It does show my favicon.ico. Why?