A simple web framework built on Pump.
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
picasso
.gitignore
LICENSE
README.md
setup.py

README.md

Picasso

Picasso is a simple web framework built on Pump.

Examples

Here's a simple example demonstrating the use of routes, forms, sessions and redirects.

from picasso import *

def home(req):
  if not req["session"].get("user"):
    return redirect("/login")
  return "<h1>Welcome back, %s!</h1>" % req["session"]["user"]

def login(req):
  return "<form method='post'><input type='submit' value='login' /></form>"

def login_post(req):
  req["session"]["user"] = "James"
  return redirect("/")

routes = setup_routes(
  GET("/", home),
  GET("/login", login),
  POST("/login", login_post),
  routing.not_found("<h1>Not Found</h1>"))

app = setup_app(routes)
pump.adapters.serve_with_paste(app)

Here's an example blog written with Picasso.

Installation

If you have pip, run

$ pip install Picasso

or get the latest snapshot from Github with

$ git clone git://github.com/adeel/picasso.git
$ cd picasso
$ python setup.py install

License

Copyright (c) 2011 Adeel Ahmad Khan adeel@adeel.ru.

MIT license.