Template
Template
動態變數
# 單一變數
<h1>hello, {{ name }}! </h1>
# 迴圈
<ul>
{% for comment in comments %}
<li>{{ comment }}</li>
{% endfor %}
</ul># python3
@app.route('/hihi',methods = ['post'])
def test_function():
name = 'strawberry'
comments = ['1', '2', '3']
# 把所有變數加入render_template
return render_template('signForm.html', name=name, comments=comments)判斷式
迴圈
Macro
import
include
set
with
Last updated