链接到Flask模板中的特定位置
发布于 2021-01-29 18:04:36
在HTML中,假设有一个具有给定id的元素,我可以直接链接到页面上的特定位置:
<a href="http://www.example.com/stuff.html#exactlocation">Go there</a>
在Flask中,我尝试将锚添加到,render_template
但得到了jinja2.exceptions.TemplateNotFound:
stuff.html#exactlocation
。
@main.route('/exactlocation')
def exactlocation():
return render_template('stuff.html#exactlocation')
如何链接到模板中的特定位置?
关注者
0
被浏览
146
1 个回答