python - Jinja range raises TemplateSyntaxError in Django view -
in django jinja2 tempate code
{% in range(10) %} foo {{ }}<br> {% endfor %}
a templatesyntaxerror
raised error message
could not parse remainder: '(10)' 'range(10)'
what need in order loop on range in jinja2 template.
i found link in django documentation explaining
because django intentionally limits amount of logic processing available in template language, not possible pass arguments method calls accessed within templates. data should calculated in views, passed templates display.
but don't think applies range function.
django not using jinja2, django template language. there no range function in django template language.
Comments
Post a Comment