本文整理汇总了Python中aspen.website.Website.renderer_factories['jinja2_xml_min']方法的典型用法代码示例。如果您正苦于以下问题:Python Website.renderer_factories['jinja2_xml_min']方法的具体用法?Python Website.renderer_factories['jinja2_xml_min']怎么用?Python Website.renderer_factories['jinja2_xml_min']使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aspen.website.Website
的用法示例。
在下文中一共展示了Website.renderer_factories['jinja2_xml_min']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Website
# 需要导入模块: from aspen.website import Website [as 别名]
# 或者: from aspen.website.Website import renderer_factories['jinja2_xml_min'] [as 别名]
import aspen
from aspen.website import Website
website = Website()
# Configure renderers
# ===================
website.renderer_default = 'unspecified' # require explicit renderer, to avoid escaping bugs
website.renderer_factories['csv_dump'] = csv_dump.Factory(website)
website.renderer_factories['jinja2_htmlescaped'] = jinja2_htmlescaped.Factory(website)
website.renderer_factories['jinja2_html_jswrapped'] = jinja2_html_jswrapped.Factory(website)
website.renderer_factories['jinja2_xml_min'] = jinja2_xml_min.Factory(website)
website.default_renderers_by_media_type['text/html'] = 'jinja2_htmlescaped'
website.default_renderers_by_media_type['text/plain'] = 'jinja2' # unescaped is fine here
def _assert(x):
assert x, repr(x)
return x
website.renderer_factories['jinja2'].Renderer.global_context.update(__builtin__.__dict__)
website.renderer_factories['jinja2'].Renderer.global_context.update({
# This is shared via class inheritance with jinja2_htmlescaped.
'assert': _assert,
'Community': Community,
'b64decode': base64.b64decode,
'b64encode': base64.b64encode,
'filter_profile_subnav': utils.filter_profile_subnav,