python's docs

1.0 template中使用dict


1. 当我们使用list时

\{\% for li in list \%\}
<li>\{\{ li \}\}</li>
\{\% endfor \%\}

2. 当我们使用dict时

<!-- key和value获取 -->
\{\% for key, value in dict.items \%\}
<li>\{\{ key \}\} - \{\{ value \}\}</li>
\{\% endfor \%\}

<!-- 仅获取key -->
\{\% for key in dict.keys \%\}
<li>\{\{ key \}\}</li>
\{\% endfor \%\}