在我的Flask应用程序中,我试图扩展烧瓶扩展(jinja2
)使用的flask-admin
模板,以添加其他macro
。通过将模板的文件名设置为扩展名使用的文件名,可以做到这一点。但是,当我尝试在模板中使用extends
关键字来引用原始模板时,这会起作用,但会出现导入循环(RecursionError: maximum recursion depth exceeded in comparison
)。我将如何完成?我试图避免复制和粘贴原始模板的内容?
供参考,this is the template I am extending和this is where that template file is imported和this is where the macro is used。