title: Get or Check Current Environment in Jinja2
body: <p>I am using Flask and Jinja2 but I am abit stuck in checking the current environment the app is running under. On the server, I am simply doing it by: </p>
  
  <pre><code># on the serverside example.py
  env = os.getenv('FLASK_CONFIG')
  </code></pre>
  
  <p>I want to achieve the same with Jinja template (in the html) file. The usecase here is to do something based on the environment the app is running under like below</p>
  
  <pre><code># In base.html
  {% if env == 'production' %}
     # do something
  {% else %}
     # do something else
  {% endif %}
  </code></pre>
  
  <p>My challenge is getting the env variable. Any help will be greatly appreciated. This could seem as a duplicate but its completely different. No need to use filters. I am not looking to get an environment variable. That one I am able to achieve via</p>
  
  <p>config['ENVIRONMENT_VARIABLE_KEY']</p>
  
  <p>What I am trying to do is get the environment itself (local, development, staging or production based on how I have set them in my config)</p>