如何在Google App Engine中运行CherryPy Web服务器 [英] How to run the CherryPy web server in the Google App Engine

查看:124
本文介绍了如何在Google App Engine中运行CherryPy Web服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这个CherryPy web服务器可以部署在Google App Engine中。

$ b是谁做的,有什么感觉?



需要做什么特别的努力(配置等)?

你会把它推荐给其他人吗?

解决方案

article 是一个很好的例子,但它现在已经过时了修补程序不再需要,最新版本的Cherrypy应该没有它,我得到了下面的示例在开发环境中运行。
我已经在一个zip文件中包含了cherrypy,因为谷歌应用程序引擎每个应用程序有一千个文件的限制,这也使得部署变得更加容易。



我还使用cherrypy dispatch处理程序来发送请求。

  import sys 
sys.path.insert (0,'cherrypy.zip')
导入cherrypy
导入wsgiref.handlers
$ b $ class根目录:
exposed = True
def GET(self) :
return给出服务的基本描述

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


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

到目前为止,我还没有遇到任何特定的问题但我已经读过一些人在会话中遇到过问题。


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?

解决方案

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.

这篇关于如何在Google App Engine中运行CherryPy Web服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆