jinja Evnironment

https://jinja.palletsprojects.com/en/master/api/#jinja2.Environment

class jinja2.Environment([options])

初始化参数

参数描述
block_start_stringThe string marking the beginning of a block. Defaults to '{%'.
block_end_stringThe string marking the end of a block. Defaults to '%}'.
variable_start_stringThe string marking the beginning of a print statement. Defaults to '{{'.
variable_end_stringThe string marking the end of a print statement. Defaults to '}}'.
comment_start_stringThe string marking the beginning of a comment. Defaults to '{#'.
comment_end_stringThe string marking the end of a comment. Defaults to '#}'.
line_statement_prefix自定义语句开头,替代block_start_string
line_comment_prefix自定义语句结尾,替代block_start_string
trim_blocks
lstrip_blocks
newline_sequence
keep_trailing_newline
extensions
optimized
undefined
finalize
autoescape
loader
cache_size
auto_reload
bytecode_cache
enable_async

对象方法

方法描述
shared
sandboxed
filters
tests
globals
policies
code_generator_class
context_class
overlay([options])
undefined([hint, obj, name, exc])
add_extension(extension)
compile_expression(source, undefined_to_none=True)
compile_templates(target, extensions=None, filter_func=None, zip=‘deflated’, log_function=None, ignore_errors=True)
extend(**attributes)
from_string(source, globals=None, template_class=None)
get_or_select_template(template_name_or_list, parent=None, globals=None)
get_template(name, parent=None, globals=None)
join_path(template, parent)
list_templates(extensions=None, filter_func=None)
select_template(names, parent=None, globals=None)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值