from django.core import serializers
from django.http import HttpResponse

def my_view(request):
    my_model = MyModel.objects.all()
response = serializers.serialize('json', my_model)
return HttpResponse(response, content_type='application/json')
Use JSONResponse to serialize a QuerySet in Django 1.7?