I am trying a simple continue inside for-loop in Flask with jinja2
continue
for-loop
{% for num in range(0,10) %} {% if num%2 == 0 %} {% print num %} {% else %} {% continue %} {% endif %}
and i get this error
TemplateSyntaxError: Encountered unknown tag 'continue'. Jinja was looking for the following tags: 'endif'. The innermost block that needs to be closed is 'if'.
Here is the jinja2 documentation I followed ... http://jinja.pocoo.org/docs/templates/#loop-controls
You need to add the extension to control Jinja 2 in your application:
app.jinja_env.add_extension('jinja2.ext.loopcontrols')
Source: https://habr.com/ru/post/945209/More articles:Why does the continue statement ignore the increment of the loop counter in the while loop, but not in the for loop? - cHow to match any character in the ANTLR parser (not lexer)? - parsingYeoman Backbone scaffold - 120 MB and 11 KB files? - backbone.jsUsing easyXDM in the same domain - same-origin-policyDownload a binary file on Node.js - node.jsGoogle Youtube Analytics API: 403 forbidden error despite valid token - youtube-apiSync Ajax download indicator - jsonCreating a project with multiple C modules (i.e. solutions) with Eclipse CDT - cGoTo in VBA - vbaVB6 / COM Interop: where do these events come from? - c #All Articles