Like Django itself, this code came up out of necessity: I was writing a quick single-page AJAXy app and came up with a few techniques and patterns to make that easy. After refining them some, I've decided to release them to the world. Hopefully they'll make your web development fast and easy.
The design was inspired by the simplicity of CherryPy coupled with the explicit expressiveness and extensibility of Django itself. You can use this code as-is, but you'll get the most benefit from reading it carefully and subclassing it to get the results you want.
A core idea is using class methods as views. The type dispatch allows for flexible subclassing.
Includes:
- extensible REST-ish Resource class, simpler than django-rest-interface (but lacking some of its features)
- class-based HTTP method dispatching
- easy AJAXy APIs
- transparent JSON serialization
- AJAX-friendly error handling
I am working on a blog mini-series that uses this code to make a small app.
Code is now available; documentation coming soon.