Я создаю таблицу HTML в Flask с помощью файла json.Вот мой файл json:
{
"data1": {
"key1": 49371,
"key2": 699
},
"data2": {
"key1": 890,
"key2": 6536
}
}
У меня есть пароль json в render_template
@app.route('/')
def index():
jsonFile = open("Stats.json", "r") # Open the JSON file for reading
data = json.load(jsonFile) # Read the JSON into the buffer
jsonFile.close() # Close the JSON file
return render_template('index.html', data= data)
Так как я могу создать строку таблицы, например, jinja2 в колбе
<tbody>
<tr>
<td>Data1</td>
<td>key1</td>
<td>key2</td>
</tr>
<tr>
<td>Data2</td>
<td>key1</td>
<td>key2</td>
</tr>
<tbody>
Заранее спасибо.Это мой первый вопрос.извините, если я сделал какую-либо ошибку:)