title: How to get list of all variables in jinja 2 templates
body: <p>I am trying to get list of all variables and blocks in a template. I don't want to create my own parser to find variables. I tried using following snippet.</p>
  
  <pre><code>from jinja2 import Environment, PackageLoader
  env = Environment(loader=PackageLoader('gummi', 'templates'))
  template = env.get_template('chat.html')
  </code></pre>
  
  <p><code>template.blocks</code> is dict where keys are blocks, how can I get all variables inside the blocks ?</p>