Skip to content

Instantly share code, notes, and snippets.

@adrienlachaize
Created November 26, 2014 21:49
Show Gist options
  • Save adrienlachaize/e1caa489bad8a96629c6 to your computer and use it in GitHub Desktop.
Save adrienlachaize/e1caa489bad8a96629c6 to your computer and use it in GitHub Desktop.
Wonderfull HTTP response to json format
import json
from django.http import HttpResponse
def json_responder(**kwargs):
"""
Return a HTTP response to json format
"""
return HttpResponse(json.dumps(kwargs), content_type="application/json")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment