Basics Basics Jinja2 uses a central object called the template Environment .Instances of this class are used to store the configuration and global objects,and are used to load...
The Meta API The Meta API Changelog New in version 2.2. The meta API returns some information about abstract syntax trees thatcould help applications to implement more advanc...
模板 模板引擎的支持 配置 Usage 内置后端 Custom backends Debug integration for custom engines Template postmortem Contextual line information Origin API and 3rd-party integration The Djan...
The form rendering API The low-level render API Built-in-template form renderers DjangoTemplates Jinja2 TemplatesSetting Context available in formset templates Context ava...
Sandbox API Operator Intercepting Sandbox The Jinja2 sandbox can be used to evaluate untrusted code. Access to unsafeattributes and methods is prohibited. Assuming env is a ...
元 API 元 API New in version 2.2. 元 API 返回一些关于抽象语法树的信息,这些信息能帮助应用实现更多的高级模板概念。所有的元 API 函数操作一个 Environment.parse() 方法返回的抽象语法树。 jinja2.meta.findundeclared_variables(_ast) Return...
Adding Extensions Adding Extensions Extensions are added to the Jinja2 environment at creation time. Once theenvironment is created additional extensions cannot be added. To ad...