/gaeskel

A lame skeleton for GAE

Primary LanguagePython

GAE Skel

A lame skeleton for GAE.

What’s in?

  • Routes (BSD): a Python re-implementation of the Rails routes system for mapping URL’s to Controllers/Actions and generating URL’s.
  • Jinja2 (BSD): a small but fast and easy to use stand-alone template engine written in pure python.
  • GAESkel (Apache2.0) – glue to assamble Routes and Jinja2 in GAE Environment.
  • Textile (BSD): a Humane Web Text Generator

WSGI implementation is based on Match Webapp URL’s Using Routes.

Hello World (in progress)

Warming up

~/Projects> git clone git://github.com/aurelian/gaeskel.git
~/Projects> cd gaeskel
~/Projects/gaeskel> cp app.yaml.sample app.yaml

change the application id to match yours.

Check your GAE!

~/Projects/gaeskel> dev_appserver.py .

One Controller. One Action to render text.

~/Projects/gaeskel> mkdir helloworld
~/Projects/gaeskel> touch helloworld/__init__.py
~/Projects/gaeskel> mkdir helloworld/controllers
~/Projects/gaeskel> touch helloworld/controllers/__init__.py
~/Projects/gaeskel> cat > helloworld/controllers/foo.py
from gaeskel.controller import Application

class Foo(Application):
  def hi(self):
    self.render_text("Har-Har HAMEL.")

^D
~/Projects/gaeskel> vim config.py

add map.connect('/hi', controller='helloworld.controllers.foo:Foo', action='hi') to Routes.

Another Controller. And a template

~/Projects/gaeskel> cat > helloworld/controllers/bar.py
from gaeskel.controller import Application

class Bar(Application):
  
  def hello_template(self):
    pass
^D

~/Projects/gaeskel> mkdir -p helloworld/templates/bar
~/Projects/gaeskel> cat > helloworld/templates/bar/hello_tempalte.html
<p>Hello Template</p>
^D

TODO

  • haml?

Contact / License

 Copyright 2008, 2009 Aurelian Oancea

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

oancea at gmail dot com