1 可以执行语句,表达式
语句:{% set a ="hello" %}
使用:{{a}}
表达式:{{a+" world"}}
2 可以调用函数
i)uimethod方式
路由: import hello1
'ui-methods':hello1
方法:hello1.py中def func(self): return "hi"
使用:html模板中{{func}}
ii)uimodule方式
路由: import hello2
'ui-modeles':hello2
方法:hello2.py中 class hello2(UIModule) def render(self):return "HELLO"
使用:html模板中{% module hello2() %}