2013-05-16 5 views
6

Ich bin ein einfaches continue in einem for-loop in Fläschchen mit jinja2 versuchtJinja2 Vorlage von Flask versagt Aussage machen WEITER

{% for num in range(0,10) %} 
    {% if num%2 == 0 %} 
    {% print num %} 
    {% else %} 
    {% continue %} 
    {% endif %} 

und ich bekomme diese Fehlermeldung

TemplateSyntaxError: Encountered unknown tag 'continue'. Jinja was looking for the following tags: 'endif'. The innermost block that needs to be closed is 'if'.

Hier die ist jinja2 Dokumentation, der ich folgte ... http://jinja.pocoo.org/docs/templates/#loop-controls

Antwort

18

Sie müssen die Schleifensteuerung hinzufügen s Erweiterung für Jinja 2 zu Ihrer App:

Verwandte Themen