Forked from philippeowagner/gist:3179eb475fe1795d6515
Last active
August 29, 2015 14:21
-
-
Save urkh/aae596edfa2e33bc7421 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.utils import simplejson | |
from django.http import HttpResponse | |
class JsonResponse(HttpResponse): | |
""" | |
JSON response | |
""" | |
def __init__(self, content, mimetype='application/json', status=None, content_type=None): | |
super(JsonResponse, self).__init__( | |
content=simplejson.dumps(content), | |
mimetype=mimetype, | |
status=status, | |
content_type=content_type, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment