Use Django view class for JSON/AJAX response.

Django’s documentation offers a working example of to create a class-based view to spit out JSON suitable for AJAX web app. This produces an easy-to-use way of responding with JSON.

https://docs.djangoproject.com/en/1.4/topics/class-based-views/

As far as I’m concerned it’s a good django-equivalent to Ruby on Rails render :xml.