xco*_*rat 3 python jinja2 pyramid
如何在金字塔中使用扩展名为.html的jinja2模板?例如,我希望视图配置看起来像,
@view_config(context=MyModel, renderer='templates/index.html')
def home_view(request):
...
Run Code Online (Sandbox Code Playgroud)
可能吗?
Mic*_*kel 17
config.add_renderer('.html', 'pyramid_jinja2.renderer_factory')
Run Code Online (Sandbox Code Playgroud)