Ich versuche, JSON-Datei von Flask in meine HTML-Seite anzuzeigen.Rendering JSON-Ausgabe auf Flask Bootstrap Seite
Flask
@app.route("/analysis")
def analysis():
data = pd.read_csv('static/uploads/' + global_file.filename)
temp_json = data.to_json(orient='records')
json_df = json.loads(temp_json)
list = json_df
return render_template('results.html', summary = json.dumps(list))
HTML
<div class="results">
<table>
{% for key in summary %}
{{ key.Name }}
{% endfor %}
</table>
</div>
JSON
Name Age Class Marks
A 12 6 32
B 13 6 32
C 14 6 43
D 12 6 54
E 13 6 23
Ich erhalte leere Seite als ouptut. Ich möchte es als einen hübschen Tisch auf der Seite anzeigen.