使用conf启动

 
app.conf
[/favicon.ico]
tools.staticfile.on: True
tools.staticfile.filename: "/path/to/myfavicon.ico"
 
test.py
import cherrypy
 
class HelloWorld(object):
   @cherrypy.expose
   def index(self):
       return "Hello World!"
 
if __name__ == '__main__':
    cherrypy.quickstart(HelloWorld(), '/', "app.conf") 

 

 

 

 

 

 

 

posted @ 2020-12-23 15:43  anobscureretreat  阅读(158)  评论(0编辑  收藏  举报