Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid block tag: 'set'

I am trying to set a variable in Jinja template. Just as simple as that. But I got error says : Invalid block tag: 'set', expected 'endblock'

Here is my template:

{% block content %}
    <div class="col-lg-7 col-lg-offset-2">
        <div style="padding-top:100px"></div>
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">
                    <i class="mdi-social-person"></i>
                    Reports
                </h3>
            </div>
            <div class="panel-body">
                    {% set index = 'a' %}
            </div>
        </div>
    </div>
{% endblock content %}

I thought set should be straight forward not this difficult.

like image 400
ismailsunni Avatar asked Sep 28 '22 03:09

ismailsunni


1 Answers

set is jinja's tag, but jinja is not Django's default templating engine as @Jharris and @Gocht mentioned in the comment. So, I need to install jinja first to use set tag.

like image 99
ismailsunni Avatar answered Oct 12 '22 23:10

ismailsunni