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

前端 未结 3 1314
面向向阳花
面向向阳花 2021-01-02 23:54

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 requi

相关标签:
3条回答
  • 2021-01-03 00:27

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

    0 讨论(0)
  • 2021-01-03 00:39

    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.

    0 讨论(0)
  • 2021-01-03 00:39

    See boodebr.org article (missing, but here on the Wayback machine) It works for me.

    If you are looking for an example, look for the condition that accepts ServerMode.GAE in ServerInterface.auto in this example.

    0 讨论(0)
提交回复
热议问题