1. 在首页添加显示问答的列表,并定义好相应的样式。

无序列表

<ul >

  <li>Coffee</li>

  <li>Tea</li>

  <li>Milk</li>

</ul>

2. 用字典向index.html传递参数。

 

<ul class="list-group">
    <li class="list-group-item" >
        <a  class="author" href="">{{ user }}</a>
        <br>
        <a class="title"  href="">标题</a>
        <br>
        <span >发布时间</span>
        <p class="abstract">内容</p>
    </li>
</ul>
@app.route('/')
def index():
    context={
        'user': 'hhh'
    }
    return render_template('index.html',**context)

 

 posted on 2017-11-30 19:18  048刘思华  阅读(141)  评论(0编辑  收藏  举报