Created
August 15, 2010 22:19
-
-
Save dickbrouwer/526019 to your computer and use it in GitHub Desktop.
This file contains 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
class JsonpResponse(HttpResponse): | |
def __init__(self, data, callback): | |
json_encoder = LazyEncoder(ensure_ascii=False) | |
json = json_encoder.encode(data) | |
jsonp = "%s(%s)" % (callback, json) | |
HttpResponse.__init__( | |
self, jsonp, | |
mimetype='application/json' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment