我使用以下命令启动脚本:
cherryd -c tiny.cfg -i 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
微小的.cfg
[global]
server.socket_host: "0.0.0.0"
[database]
driver: "mysql"
host: "localhost"