标签:渲染 name return code 规范 point == inf turn
from flask import Flask,render_template,request,redirect,session,url_for,Markup
app = Flask(__name__)
app.debug = True
app.secret_key = 'sdfsdfsdfsdf'
USERS = {
1:{'name':'张三','age':18,'gender':'男','text':"道路千万条"},
2:{'name':'李四','age':28,'gender':'男','text':"安全第一条"},
3:{'name':'王五','age':18,'gender':'女','text':"行车不规范"},
}
def func1(st,st1):
return Markup(f"<h1>jsaon-gdx{st}{st1}</h1>")
@app.route('/list',methods=['GET'])
def list():
info=USERS
return render_template('list.html',info=info,html="<h1>jsaon-gdx</h1>",html1=func1)
@app.route('/detail/<int:nid>',methods=['GET'],endpoint="sb")
def detail(nid):
return "ok"
if __name__ == '__main__':
app.run()
标签:渲染 name return code 规范 point == inf turn
原文地址:https://www.cnblogs.com/suren-apan/p/11966145.html