Python jinja模板扩展了相对/绝对路径
我的文件夹结构看起来像Python jinja模板扩展了相对/绝对路径,python,jinja2,Python,Jinja2,我的文件夹结构看起来像 └── templates ├── base.html ├── foo │ ├── 1.html │ ├── 2.html └── bar ├── 1.html └── 2.html 如何用base.html扩展1.html、2.html? “./”在模板内不起作用 {%extends../base.html%%} env = Environment(loader=FileSystemLoa
└── templates
├── base.html
├── foo
│ ├── 1.html
│ ├── 2.html
└── bar
├── 1.html
└── 2.html
如何用base.html扩展1.html、2.html?
“./”在模板内不起作用
{%extends../base.html%%}
env = Environment(loader=FileSystemLoader('templates/%s/' % (channel == 0 and 'foo' or 'bar')))
templ = templateId + '.html'
templ = env.get_template(templ)
output = templ.render(data=data)
我得到{TemplateNotFound}../base.html