I have a WSGI app embedded (grafted) in my CherryPy server.
from my_app import application
import cherrypy
if __name__ == '__main__':
cherrypy.config.update("server.conf")
cherrypy.tree.graft(application, "/good_stuff/")
cherrypy.engine.start()
cherrypy.engine.block()
Where server.conf
is the static configuration file which defines the server properties and so on.
[global]
server.socket_host = "0.0.0.0"
server.socket_port = 8087
server.thread_pool = 30
Now I would like to run CherryPy as a daemon service my using the cherryd
utility, so I should turn the grafting part in the code to static configuration.
[global]
...
tree.graft = {my_app.application:"/good_stuff/"}
I couldn't find working examples on this, but it is clearly not OK:
AttributeError: 'ReloaderApp' object has no attribute 'rstrip'
as I try to launch it:
$ cherryd -c server.conf -i my_app
Ideas?