码迷,mamicode.com
首页 > 其他好文 > 详细

制作首页的显示列表。

时间:2017-12-01 13:36:20      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:img   app   制作   传递参数   blog   列表   use   pre   image   

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

无序列表

<ul >

  <li>Coffee</li>

  <li>Tea</li>

  <li>Milk</li>

</ul>

<div id="list-container">
        <ul>
            <li class="list-group-item">
                <span class="glyphicon glyphicon-leaf" aria-hidden="true"></span>
                帐号:<a href="#" target="_blank">{{ username }}</a>
                <br>
                <a href="#">{{ title }}</a>
                <span class="badge">creat_time</span>
                <p style="...">{{ questions }}</p>
            </li>
        </ul>
    </div>

 

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

@app.route(/index/)
def index():
    context={
        questions:wowwowwow
    }
    return render_template(index.html,**context)

 技术分享图片

制作首页的显示列表。

标签:img   app   制作   传递参数   blog   列表   use   pre   image   

原文地址:http://www.cnblogs.com/zsy-97/p/7941278.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!