Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 MoinMoin 和烧瓶的新手。我有一个使用 python 宏的 moinmoin 站点。目前,我只是使用一些基本的字符串格式方法从我的宏中返回 html。我想将烧瓶模板与该render_template方法一起使用。它现在不起作用,因为上下文堆栈似乎是空的。我真的不知道使它工作的好方法是什么。我应该通过给它宏对象本身或宏请求来创建一个带有烧瓶的上下文吗?
render_template
当您使用宏时,您很可能使用Jinja2 宏(Python 没有宏)。在这种情况下,您可以使用includeorimport指令来加载其他 Jinja 模板并渲染它们。
include
import