# -*- coding: utf-8 -*-
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/test1")
def test1():
return render_template("index1.html",
title="test1", text1="aaa", text2="bbb", text3="ccc")
@app.route("/test2")
def test2():
templateData = {
'text1' :
"aaa",
'text2' :
"bbb",
'text3' : "ccc"
}
return render_template("index1.html",
title="test2", **templateData)
@app.route("/test3")
def test3():
texts = []
texts.append("aaa")
texts.append("bbb")
texts.append("ccc")
return render_template("index3.html",
title="test3", text=texts)
if __name__ == "__main__":
#app.run()
app.run(host='0.0.0.0', port=8000,
debug=True)~
|