I'm having an issue changing the default cherrypy favicon to my own, called book.ico located in public/images/books.ico. I've tried disabling it already using the following code:
'/favicon.ico': {
'tools.staticfile.on': False,
}
But the icon still shows up as a tab label. I'm browsing to the site in incognito mode with chrome.
import cherrypy
import os
import glob
class HelloWorld(object):
favicon_ico = None
@cherrypy.expose
def index(self):
return file('public/html/index.html')
... skipping over def generate(self, name)
if __name__ == '__main__':
cherrypy.config.update({
'server.socket_host':
'192.168.2.9','server.socket_port':8080,
'/static': {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.getcwd(),
},
'/public': {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(os.getcwd(), "/public"),
},
'/favicon.ico': {
'tools.staticfile.on': True,
'tools.staticfile.filename': os.path.join(os.getcwd(), '/public/images/books.ico')
}
})
cherrypy.tree.mount(HelloWorld())
cherrypy.engine.start()
cherrypy.engine.block()
directory structure
.
├── app.conf
├── bin
│ ├── activate
│ ├── activate.csh
│ ├── activate.fish
│ ├── activate_this.py
│ ├── cherryd
│ ├── easy_install
│ ├── easy_install-2.7
│ ├── pip
│ ├── pip2
│ ├── pip2.7
│ ├── python
│ ├── python2 -> python
│ └── python2.7 -> python
├── books.ico
├── CherrypyProd.py
├── images
├── pip-selfcheck.json
├── public
│ ├── css
│ ├── html
│ │ ├── books.png
│ │ └── index.html
│ └── images
│ ├── books.ico
│ └── books.png
├── ssl
├── static
└── books.png
How can i replace the default favicon.ico with my own books.ico???
Thank you in advance for your help. Please let me know if I can clarify anything further.