There are two ways to use Jinja2 as Tornado’s default template engine:
- Inherited from mixed TemplateRendering class, and rewrite tornados’s render() function
- Set Jinja2 template loader as the default template loader while initialize Application
For implemention 1:
Please refer to: Using Jinja2 as the Template Engine for Tornado Web Framework
For implemention 2:
Please refer to: 在Tornado中使用jinja2模版引擎的简单方法