from django http import HttpResponse from django utils import simplejs

1
2
3
4
5
6
7
from django.http import HttpResponse
from django.utils import simplejson
class JsonResponse(HttpResponse):
def __init__(self, data):
super(JsonResponse, self).__init__(
content=simplejson.dumps(data), mimetype='application/json')