jespern / django-piston (http://bitbucket.org/jespern/)
Piston is a Django mini-framework creating APIs.
$ hg clone http://bitbucket.org/jespern/django-piston
Piston
Get the latest version (0.2.2) here.
Read the release notes / what's new for 0.2.2.
NEW: Discussion group is hosted on Google Groups.
A mini-framework for Django for creating RESTful APIs.
Piston is a relatively small Django application that lets you
create application programming interfaces (API) for your sites.
It has several unique features:
- Ties into Django's internal mechanisms.
- Supports OAuth out of the box (as well as Basic/Digest or custom auth.)
- Doesn't require tying to models, allowing arbitrary resources.
- Speaks JSON, YAML, Python Pickle & XML (and HATEOAS.)
- Ships with a convenient reusable library in Python
- Respects and encourages proper use of HTTP (status codes, ...)
- Has built in (optional) form validation (via Django), throttling, etc.
- Supports streaming, with a small memory footprint.
- Stays out of your way.

NB: OAuth ships with piston for now, but you are not required to use it. It simply provides some boilerplate in case you want to use it later (consumer/token models, urls, etc.)
Documentation
But, examples speak louder than documentation:
Fully functional example
urls.py:
And as for handlers.py:
And that's all there's to it.
Getting Help
Piston is well documented and has an ever-growing FAQ. Feel free to add entries you find helpful to the FAQ.
Go read the Documentation.
This revision is from 2010-06-06 15:19
