读取conf中的内容

 
app.conf
[/]
tools.gzip.on: True
 
[googleapi]
key = "..."
appid = "..."
 
test.py
class Root(object):
    @cherrypy.expose
    def index(self):
        google_appid = cherrypy.request.app.config['googleapi']['appid']
        return "hello world!"
 
cherrypy.quickstart(Root(), '/', "app.conf") 

 

 

 

 

 

 

 

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