CSS Flask Basics Character Builder Loop Nested Items

Apirom Na Nakorn
Apirom Na Nakorn
10,711 Points

What is structure for teachers variable look like ?

What is structure for teachers variable look like ?

flask_app.py
from flask import Flask, render_template

from teachers import TEACHERS

app = Flask(__name__)


@app.route('/')
def index():
    return render_template("teachers.html", teachers=TEACHERS)
templates/teachers.html
<ul class="teachers">
  {% for key in teachers %}
     <li><h2>{{ teachers[key]['name'] }}</h2></li>
  {% endfor %}
</ul>
alert('hello')