Last active
December 11, 2015 10:08
-
-
Save mekarpeles/4584751 to your computer and use it in GitHub Desktop.
An basic example implementing an application in Waltz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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