from flask import jsonify
@app.route('/summary')
def summary():
d = make_summary()
return jsonify(d)
#to manage json data in a request you have to use the get_json request method.
@app.route("/route", methods=["POST"])
def route():
data = request.get_json()
# use data
return redirect("/")