【发布时间】:2015-01-08 22:44:05
【问题描述】:
到目前为止,我试图在模板中显示文本文件的内容,但没有任何运气。这是 到目前为止我的代码:
@route('/show_article/<filename>')
def show_article(filename):
stat_art=static_file(filename, root="articles")
return template('show_article', stat_art=stat_art)
这是我的模板中显示文件内容的段落
<p>
{{stat_art}}
</p>
我知道我可以只返回 static_file() 但我需要设计页面 稍后会添加一些 CSS 和其他内容。
提前致谢,如果我的英语不正确,我们深表歉意!
【问题讨论】:
标签: python return text-files bottle static-files