Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run the CherryPy web server in the Google App Engine

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?

like image 896
Rob Williams Avatar asked Dec 18 '08 21:12

Rob Williams


1 Answers

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.

like image 126
RoutineOp Avatar answered Oct 19 '22 09:10

RoutineOp