data = serializers.serialize('json', [obj])
struct = json.loads(data)
data = json.dumps(struct[0])
return HttpResponse(data, mimetype='application/json')
How do you serialize a model instance in Django?