How do you assign a wsgi app to the root of cherrypy via the config file? I'd like the request "http://localhost:8080/" to route to my own wsgiapp. I'm using cherryd to start a cherrypy server with a config file as follows:
Here's the invocation:
cherryd --config config.cfg --import myapp
Here's the config.cfg file:
[global]
server.socket_host: "127.0.0.1"
server.socket_port: 8080
tree.apps: { "/" : myapp.wsgiapp }
Here's the myapp.py module:
def wsgiapp(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return ['Hello World']
Here's the error message:
File "/Users/samwan/Documents/myproject/virtual_environment/lib/python2.5/site-packages/CherryPy-3.1.2-py2.5.egg/cherrypy/_cpconfig.py", line 331, in _tree_namespace_handler
cherrypy.tree.graft(v, v.script_name)
AttributeError: 'dict' object has no attribute 'script_name'