Google App Engine 的简单框架(如 Sinatra)?

发布于 2024-08-08 02:11:40 字数 368 浏览 4 评论 0原文

appengine 是否有一个简单的“包装”框架?类似于 Sinatra朱诺?这样就可以编写如下代码:

from juno import *

@route('/')
def index(web):
    return 'Juno says hi'

run()

更新:我想在GAE中使用Python API(而不是Java)。

Is there a simple 'wrapper' framework for appengine? Something like Sinatra or Juno? So that one can write code like the following:

from juno import *

@route('/')
def index(web):
    return 'Juno says hi'

run()

UPDATE: I want to use the Python API (not Java) in GAE.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

倚栏听风 2024-08-15 02:11:41

据我所知,目前还没有发布这样的框架(我猜大多数人似乎对 Django 非常满意;-)。您可以尝试将 Juno 与此补丁一起使用 - 它似乎还没有完全准备好迎接黄金时段,但话又说回来,这是一个非常小的补丁,也许只需要一点点就可以让 Juno 完全在 GAE 上工作!

No such framework has been released at this time, to the best of my knowledge (most people appear to be quite happy with Django I guess;-). You could try using Juno with this patch -- it doesn't seem to be quite ready for prime time, but then again, it IS a pretty tiny patch, maybe little more is needed to allow Juno to work entirely on GAE!

甜心小果奶 2024-08-15 02:11:41

我使用 web.py。它非常简单,并且不会妨碍您。

它看起来是这样的:

import web

urls = (
    '/(.*)', 'hello'
)
app = web.application(urls, globals())

class hello:        
    def GET(self, name):
        if not name: 
            name = 'world'
        return 'Hello, ' + name + '!'

if __name__ == "__main__":
    app.run()

I use web.py. It's really simple and doesn't get in your way.

This is how it looks:

import web

urls = (
    '/(.*)', 'hello'
)
app = web.application(urls, globals())

class hello:        
    def GET(self, name):
        if not name: 
            name = 'world'
        return 'Hello, ' + name + '!'

if __name__ == "__main__":
    app.run()
执手闯天涯 2024-08-15 02:11:41

我一直想尝试的另一个框架是 Blog。它实际上是 GAE 的博客引擎,但也提供了用于开发其他 GAE 应用程序的框架。

Another framework that I've been meaning to try out is Bloog. It is actually a blog engine for GAE but also provides a framework for developing other GAE apps.

和影子一齐双人舞 2024-08-15 02:11:41

Bottle 是一个单文件框架,因此部署起来非常容易盖伊。

Bottle 与 Sinatra 类似,请参见下面的“hello world”示例:

Sinatra:

require 'sinatra'
get '/hi' do
  "Hello World!"
end

Bottle:

from bottle import *
@get('/hi')
    def hi():
        return "Hello World!"

虽然我不得不承认 Ruby 对于 DSL 来说更好。

Bottle is one-single-file framework, so it's very easy to deploy it on GAE.

Bottle is similar with Sinatra, see the "hello world" example below:

Sinatra:

require 'sinatra'
get '/hi' do
  "Hello World!"
end

Bottle:

from bottle import *
@get('/hi')
    def hi():
        return "Hello World!"

Though I have to admit that Ruby is better for DSL.

临风闻羌笛 2024-08-15 02:11:41

您应该查看 gaelyk。它是一个基于 appengine 的轻量级框架,使用 Groovy。

You should check out gaelyk. It's a lightweight framework on top of appengine that uses groovy.

谜兔 2024-08-15 02:11:40

有几个专门针对 App Engine 或非常适合它的框架:

There are several frameworks either specifically for App Engine, or well suited to it:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文