【问题标题】:How to run the CherryPy web server in the Google App Engine如何在 Google App Engine 中运行 CherryPy 网络服务器
【发布时间】:2010-09-27 14:51:43
【问题描述】:

CherryPy 网络服务器据说可以部署在 Google App Engine 中。

谁做过,体验如何?

需要什么特别的工作(配置等)?

你会推荐给其他人吗?

【问题讨论】:

    标签: google-app-engine cherrypy


    【解决方案1】:

    article 是一个很好的例子,但它现在作为patch is no longer required 有点过时了,最新版本的 Cherrypy 应该在没有它的情况下运行,我已经在开发环境中运行了下面的示例。 我已将cherrypy 包含在一个zip 文件中,因为谷歌应用引擎每个应用程序限制为一千个文件,这也使其更易于部署。

    我还使用cherrypy调度处理程序来路由请求。

     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)
    

    到目前为止,我还没有遇到任何特定问题,但我读到有些人在会话方面遇到问题。

    【讨论】:

      【解决方案2】:

      参见 boodebr.org 文章(缺失,但 here on the Wayback machine)它对我有用。

      如果您正在寻找示例,请在 this example 的 ServerInterface.auto 中寻找接受 ServerMode.GAE 的条件。

      【讨论】:

      • 请检查您的链接 - 我收到的是 404。
      【解决方案3】:

      有一篇关于如何做到这一点的好文章 over here now here。我还没有真正尝试过,我在 App Engine 上坚持使用 django,但这似乎是一个可靠的例子。

      【讨论】:

      • 呵呵,“在 App Engine 上卡住了 Django”是对当前事态的恰当描述。
      猜你喜欢
      • 2013-10-31
      • 2011-02-15
      • 2017-11-12
      • 1970-01-01
      • 2011-07-27
      • 2014-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多