制作首页的显示列表。
{% extends 'base.html' %} {% block title %}首页{% endblock %} <meta charset="UTF-8"> {% block main %} <img src="{{ url_for('static',filename='images/86x97sZ11K4.jpg') }}" alt="qa"> <p>{{ username }}contextx</p> <ul class="list-group" style="align-content: center"> <li class="list-group-item"> <span class="glyphicon glyphicon-leaf" aria-hidden="true"></span> <a href="#">user</a> <br> <a href="#">标题</a> <span class="badge">发布时间</span> <p style="text-indent: 18px">内容</p> </li> </ul> {% endblock %}
@app.route('/') def index(): context={ 'user':'mis' } return render_template('index.html',**context)