制作首页的显示列表

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

无序列表

<ul >

  <li>Coffee</li>

  <li>Tea</li>

  <li>Milk</li>

</ul>

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

 

 <div class="listbox">
        <ul class="alist">
            <li class="list">
                <a href="#">{{ username }}</a><br>
                <a href="#">Question:{{ title }}</a><br>
                <a href="#">Detail:{{ detail }}</a>
                <span class="badge">{{ create_time }}TIME</span>
                <p></p>
            </li>
        </ul>
        </div>
@app.route('/index/')
def index():
    contex={
        'user':'mis'
    }
    return render_template('index.html')

 

posted @ 2017-12-02 21:58  092曹馨文  阅读(196)  评论(0编辑  收藏  举报