A simple framework for Google App Engine (like Sinatra)?
Asked Answered
C

6

5

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.

Concepcionconcept answered 20/10, 2009 at 1:59 Comment(1)
Funny. I was thinking I wanted something like that, just yesterday. Getting sick of running backwards and forwards between urls.py (in django) or the yaml file in GAE.Zuleika
C
7

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

Colan answered 20/10, 2009 at 9:21 Comment(1)
Thanks. A quick look at the mentioned frameworks suggests that kay is something I'd like better than the others. I will spend some time with kay and report my thoughts on it later.Concepcionconcept
F
2

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!

Footed answered 20/10, 2009 at 3:8 Comment(4)
Yea, I already looked at this patch before .. it disables templates/ORM resulting in a pretty useless framework.Concepcionconcept
@Sridhar, obviously you can't have ORMs in GAE since there's no R (GAE's storage is non-relational), and the templates available are only those you can do in pure Python (django being most popular, though I still like my ancient YAPTU;-), not jinja or others needing C-coded extensions. To use App Engine effectively, you must accept its limitations -- non-relational storage, and pure-Python-only extensions.Footed
True, but at least Juno's "Person = model('Person', ...)" API could be translated to the underlying appengine models. That patch didn't cover that.Concepcionconcept
@Sridhar, yep, it's a tiny patch -- not quite ready, as I said, but close enough to "need little more" (within what can be done on GAE of course) -- only the Juno maintainers know their plans for sure, but one or two volunteers to help on this might make all the difference.Footed
I
2

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()
Id answered 20/10, 2009 at 9:4 Comment(0)
B
1

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.

Bifocal answered 20/10, 2009 at 6:50 Comment(0)
S
1

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.

Sewerage answered 6/12, 2010 at 13:22 Comment(0)
U
0

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

Urata answered 20/10, 2009 at 2:43 Comment(1)
But that is for the Java API; I need one for the Python API.Concepcionconcept

© 2022 - 2024 — McMap. All rights reserved.