
原因 数组名不能有_
team_list = [
{"id": 1, "name": "a"},
{"id": 2, "name": "b"},
{"id": 3, "name": "c"},
{"id": 4, "name": "d"},
]
@app.route("/team/list")
def team_list():
return jsonify(team_list)
报错
改成
teamlist = [
{"id": 1, "name": "a"},
{"id": 2, "name": "b"},
{"id": 3, "name": "c"},
{"id": 4, "name": "d"},
]
@app.route("/team/list")
def team_list():
return jsonify(teamlist)
成功
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)