title: Access global variable inside Jinja2 include
body: <p>I have a template like so:</p>
  
  <pre><code>{% extends 'master.html' %}
  {% set myVar = true %}
  
  ...
  
  {% block myBlock %}
      {% include '/includes/myinclude.html' %}
  {% endblock %}
  </code></pre>
  
  <p>I am unable to access <code>myVar</code> inside of my include. However, if I do this:</p>
  
  <pre><code>{% block myBlock %}
      {% set myVar = myVar %}
      {% include '/includes/myinclude.html' %}
  {% endblock %}
  </code></pre>
  
  <p>magically, it's accessible. Obviously I don't want to have to set my variables in two different places. What am I doing wrong, or is this just a dumb thing that Jinja2 does?</p>