Skip to content

Instantly share code, notes, and snippets.

@mekarpeles
Created February 8, 2013 02:23
Show Gist options
  • Save mekarpeles/4736133 to your computer and use it in GitHub Desktop.
Save mekarpeles/4736133 to your computer and use it in GitHub Desktop.
The new and improved waltz v.0.1.64
#!/bin/bash
sudo pip install --upgrade waltz
import waltz
from waltz import User, session, render
urls = ('/', 'Index')
sessions = {'logged': False, 'uid': None}
app = waltz.setup.dancefloor(urls, globals(), sessions=sessions)
class Index:
"""Introducing Waltz 0.1.64 Spotlight -- The 'User' module"""
def GET(self):
"""Creates a user within lazydb and returns the user dict to
the client """
# creates user and saves in LazyDB
User.register('username', '******')
# retrieves the user from LazyDB by pkey
return User.get('username')
if __name__ == "__main__":
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment