views:

1156

answers:

3

The CherryPy web server can supposedly be deployed in the Google App Engine.

Who has done it, and what was the experience like?

What special effort was required (configuration, etc.)?

Would you recommend it to others?

A: 

There is a good article on how to do this over here. I haven't actually tried this yet, I stuck with django on App Engine, but it seems to be a solid example.

Jack M.
Hehe, "stuck w/ Django on App Engine" is an apt description of the current state of affairs.
Adam Bernier
+1  A: 

The article is a good example but its slightly out of date now as the patch is no longer required, the latest version of Cherrypy should run without it, I've gotten the sample below running in the development environment. I've included cherrypy inside a zip file as the google app engine has a limit of one thousand files per application, it also makes it easier to deploy.

I'm also using the cherrypy dispatch handler to route the request.

 import sys
    sys.path.insert(0, 'cherrypy.zip')
    import cherrypy
    import wsgiref.handlers 

    class Root:
        exposed = True
        def GET(self):
            return "give a basic description of the service"

    d = cherrypy.dispatch.MethodDispatcher()
    conf = {'/': 
            {
             'request.dispatch': d
            }
           }

    app = cherrypy.tree.mount(Root(), "/",conf)
    wsgiref.handlers.CGIHandler().run(app)

So far I've not come across any particular issues but I have read some people have had issues with sessions.

Eoin
A: 

See boodebr.org/main/python/cherrypy-under-google-appserver. It works for me.

If you are looking for an example, look for the condition that accepts ServerMode.GAE in ServerInterface.auto in http://code.google.com/p/yotsuba/source/browse/trunk/yotsuba3-python/yotsuba3/lib/tori.py.

Shiroyuki