url_for解析报错
来源:2-1 模板及模板引擎介绍
QXY_DZ
2022-10-30 10:31:19
@app.route('/index/')
def Index():
index = make_response('需要在页面上显示的内容(Index.html)', 200, {
'key1': 'value1',
'key2': 'value2'
})
return index
@app.route('/urlfor/')
def Test_urlfor():
print(url_for('index', _external=True))
return render_template('render_template.html')
url_for函数解析报错
这是什么问题呢?
1回答
时间,
2022-10-30
同学,你好!url_for()的第一个参数为函数名,应该是Index
祝学习愉快!
相似问题
回答 1
回答 1