Nineteen: jinja2 the set and define variables with statement

 

 

set

jinja2 internal template can define a variable set, as long as the definition of this variable, the code can later use this variable

 

with

If you want to define a variable scope only in part effective, more practical set is not tender, need to use with the definition, with the scheduled variables you with tender statement, Invalid out of range

 

Guess you like

Origin www.cnblogs.com/zhongyehai/p/11784591.html