python - Display json along with html template in flask -
how return json along html template below in flask?.
@app.route('/test') def test(): = { "test1": flag, "test2": flag } return ''' <body> ... </body> '''
@app.route('/test') def test(): = { "test1": flag, "test2": flag } b = jsonify(a) render_template("index.html",**locals())
in html file, can call a,b etc..
{{b}}
{{a}}
Comments
Post a Comment