Django template control of statement if and for loop

{% If%} use

{% For%} use

forloop.counter counter, the default is 1, any number may be provided

forloop.revcounter0 flashback

forloop.first first time through the loop the value True

{% Empty%} is empty

Guess you like

Origin www.cnblogs.com/jintian/p/11135865.html