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.

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