Skip to main content

A simple web framework for Python.

Project description

# Picasso

Picasso is a simple web framework built on [Pump](http://adeel.github.com/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](https://github.com/adeel/picasso-blog-example) written with Picasso.

## License

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

MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Picasso-0.0.2.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

Picasso-0.0.2-py2.7.egg (12.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page