title: Why the Simple tag in django is not working?
body: <p>I have made a custom tag to set up a flag in my code (for logic).
  I have used <a href="https://micropyramid.com/blog/django-custom-template-tags-and-filters/" rel="nofollow noreferrer">link</a> as a reference to set up flag.</p>
  
  <p>Here is the code of my custom tag:</p>
  
  <pre class="lang-py prettyprint-override"><code>
  from django import template
  
  register = template.Library()
  
  @register.simple_tag
  def update_variable(value):
      data = value
      return str(data)
  
  </code></pre>
  
  <p>My app directory:</p>
  
  <pre><code>├── admin.py
  ├── apps.py
  ├── database_consistency.py
  ├── forms.py
  ├── __init__.py
  ├── models.py
  ├── templatetags
  │   ├── __init__.py
  │   └── vars.py
  ├── tests.py
  ├── urls.py
  └── views.py
  </code></pre>
  
  <p>Basiclly I am trying to set up a flag in template:</p>
  
  <pre class="lang-py prettyprint-override"><code>                        &lt;!--Diamonds:--&gt;
                          &lt;!--Initialized diamond_flag--&gt;
                          {% with diamond_flag as False %}
                          {% for diamond in item.diamonds.all reversed %}
                            {% update_variable False as diamond_flag %}
                            {% if forloop.first and diamond.rate != 0 %}
                                       ...
                              &lt;!--Trying to update the flag--&gt;
                              {% update_variable "True" as diamond_flag %}
                            {% endif %}
                          {% endfor %}
                            {% if diamond_flag == "True" or diamond_flag == "1" or diamond_flag == 1 or diamond_flag == True  %}
                              &lt;td&gt;Working&lt;/td&gt; &lt;!--This line is not working, the code never runs--&gt;
                              &lt;td&gt;-&lt;/td&gt;
                            {% endif %}
  
  
  </code></pre>
  
  <p>I want the flag value to be True between the code so the following 'if' conditions gets true and the code runs accordingly.</p>