38

flask中jinjia2模板引擎使用详解4-挨踢学霸

 6 years ago
source link: http://blog.51cto.com/12482328/2083612
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
接上文For循环和其它编程语言一样,for用来编辑列表中的项。下面以一个例子来说明for在flask的jinjia2模板中的使用。创建一个模板list.html代码如下:{% extends "base.html" %}{% block content %}     {% for user in users %}     <li>{{ user }}</li>     {

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK