Home:ALL Converter>Cherrypy: Getting app config settings when starting with cherryd

Cherrypy: Getting app config settings when starting with cherryd

Ask Time:2013-01-15T04:17:27         Author:dave

Json Formatter

I use the following command to start the script:

cherryd -c tiny.cfg -i tiny

But I cannot read the app config settings (database). What is wrong?

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"

Author:dave,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/14325954/cherrypy-getting-app-config-settings-when-starting-with-cherryd
yy