Dumb App Engine Shortcuts
I like using App Engine's webapp framework. It's very simple and similar to the web.py framework. However, simple tasks such as outputting data or rendering templates require way too much boilerplate text. For example, to output a rendered template, you must type:
disp = self.response.out.write
def render(template_name, template_values):
path = os.path.join(os.path.dirname(__file__), '%s' % template_name)
disp(template.render(path, template_values))
Now to render a template, simply use
return render('index.html', {'form' : someForm()}).
Think of this as App Engine's version of Django's
Render_to_Response function ;).
Similarly, if all you want to do is spit out data that won't go through a template just use
return disp("some string").
Alan
11 February 2009