Created
August 3, 2013 16:27
-
-
Save wong2/6147032 to your computer and use it in GitHub Desktop.
flask jsonify decorator
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
import json | |
# jsonify response decorator | |
def jsonify(f): | |
def wrapped(*args, **kwargs): | |
return Response(json.dumps(f(*args, **kwargs)), mimetype='application/json') | |
return wrapped |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need to add: