[问题] template 问题

楼主: gn00618777 (非常念旧)   2015-02-12 16:52:23
我在 A 资料夹有 a.html a1.html a2.html,a.html内容是
<li class="link">
<a target="main" href="net_interfaces.html">
Network Interfaces
</a>
</li>
我在 templates 资料夹 有个 b.html,这个html 在我的 python 主程式
是会被 return render_template('b.html', **templateData)
而a.html在 python 主程式中是直接被 return send_from_directory('xx/xx/A','a.html')
我想将 a.html 中的 net_interfaces.html 改成 templates 资料夹中的 html
会找不到URL,输入完整路径也无法。只能选择同在 A 资料夹中的 a1.html or a2.html
请问要怎么修改让我能存取到 templates 资料夹中的 html?
ps 不是直接用 render_template('b.html',**templateData)
而是希望用 send_from_directory('','a.html'),并且透过a.html内的超连结
存取到 template 里的 html 。谢谢。 想了一天了~"~
作者: uranusjr (←這人是超級笨蛋)   2015-02-12 23:27:00
‘透过a.html内的超连结存取到 template 里的 html’这件事无法直接用 Flask 办到, 请乖乖写 view
楼主: gn00618777 (非常念旧)   2015-02-14 20:02:00
好的,谢谢。

Links booklink

Contact Us: admin [ a t ] ucptt.com