Skip to content

Instantly share code, notes, and snippets.

@mekarpeles
Last active December 11, 2015 10:08
Show Gist options
  • Save mekarpeles/4584751 to your computer and use it in GitHub Desktop.
Save mekarpeles/4584751 to your computer and use it in GitHub Desktop.
An basic example implementing an application in Waltz
#!/usr/bin/env Python
import waltz
from waltz import track, db, render, session
urls = ('/session', 'Session',
'/analytics', 'Analytics',
'/', 'Index')
sessions = {'cart': waltz.Cart()}
app = waltz.setup.dancefloor(urls, globals(), sessions=sessions)
class Index:
@track
def GET(self):
return render().index()
class Session:
def GET(self):
return session()
class Analytics:
def GET(self):
return db().get('analytics')
if __name__ == "__main__":
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment