11.29
1. 在首頁添加顯示問答的列表,并定義好相應(yīng)的樣式。
無序列表
<ul >
? <li>Coffee</li>
? <li>Tea</li>
? <li>Milk</li>
</ul>
{% block main %}<img src="{{ url_for('static',filename='images/qalogo.png') }}"alt="qa"><p>{{ username }}contextx</p><ul class="list-group" style=""><li class="list-group-item"><span class="glyphicon glyphicon-leaf" aria-hidden="true"></span><a href="#">{{ user }}</a><br><a href="#">標(biāo)題</a><span class="badge">發(fā)布時(shí)間</span><a style="">內(nèi)容</a></li></ul> {% endblock %}2. 用字典向index.html傳遞參數(shù)。
@app.route('/') def shouye():context={'user':'mis3'}return render_template('shouye.html',**context)?
轉(zhuǎn)載于:https://www.cnblogs.com/chenyanxi123/p/7920953.html
總結(jié)
- 上一篇: [elk]logstash grok原理
- 下一篇: JDK1.7和JDK1.8对于异常的支持