制作首页的显示列表
. 在首页添加显示问答的列表,并定义好相应的样式。
无序列表
<ul >
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
2. 用字典向index.html传递参数。
{% block main %} <body id="myBody"> <P align="center" style="background-color:rgba(255,255,0,0.25)">{{username}}请登录</P> <ur class="sss"> <li class="list"> <span class="glyphicon" aria-hidden="true"></span> <a href="#">{{user}}</a> <br> <a href="#">标题</a> <span class="badge">发布时间 </span> <p>内容</p> </li> </ur> {% endblock %} </body> </html>
@app.route('/') def danghangye(): context = { 'user':'mis' } return render_template('danghangye.html',**context)