0
我用下面的命令来启动脚本启动时:CherryPy的:获取应用程序的配置设置与cherryd
cherryd -c tiny.cfg -i tiny
但我无法读取应用程序配置设置(数据库)。哪里不对?
tiny.py
import cherrypy
class HelloWorld:
def index(self):
return "Hello world!"
index.exposed = True
app = cherrypy.tree.mount(HelloWorld(), '/')
print 'app.config', app.config
print 'cherrypy.config', cherrypy.config
tiny.cfg
[global]
server.socket_host: "0.0.0.0"
[database]
driver: "mysql"
host: "localhost"