etiquette/etiquette_flask/jsonify.py
Ethan Dalool a9c7ad6993 Improve separation between front & back with etiquette_flask package
Move flask-specific operations out of etiquette's files and into new etiquette_flask. In etiquette_site.py, etiquette calls are fully qualified.
2017-05-01 21:23:16 -07:00

9 lines
245 B
Python

import flask
import json
def make_json_response(j, *args, **kwargs):
dumped = json.dumps(j)
response = flask.Response(dumped, *args, **kwargs)
response.headers['Content-Type'] = 'application/json;charset=utf-8'
return response