Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在金字塔中使用带有 .html 扩展名的 jinja2 模板?例如,我希望视图配置看起来像,
@view_config(context=MyModel, renderer='templates/index.html') def home_view(request): ...
是否可以?
config.add_renderer('.html', 'pyramid_jinja2.renderer_factory')
在最近的版本中:
config.add_jinja2_renderer(".html")