code: def generate_options_map():
      
      try:
          return settings.PUENTE['JINJA2_CONFIG']
      except KeyError:
          pass
  
      # If using Django 1.8+, we can skim the TEMPLATES for a backend that we
      # know about and extract the settings from that.
      for tmpl_config in getattr(settings, 'TEMPLATES', []):
          try:
              backend = tmpl_config['BACKEND']
          except KeyError:
              continue
  
          if backend == 'django_jinja.backend.Jinja2':
              extensions = tmpl_config.get('OPTIONS', {}).get('extensions', [])
              return {
                  '**.*': {
                      'extensions': ','.join(extensions),
                      'silent': 'False',
                  }
              }
  
      # If this is Django 1.7 and Jingo, try to grab extensions from
      # JINJA_CONFIG.
      if getattr(settings, 'JINJA_CONFIG'):
          jinja_config = settings.JINJA_CONFIG
          if callable(jinja_config):
              jinja_config = jinja_config()
          return {
              '**.*': {
                  'extensions': ','.join(jinja_config['extensions']),
                  'silent': 'False',
              }
          }
  
      raise CommandError(
          'No valid jinja2 config found in settings. See configuration '
          'documentation.'
      )
docs: Generate an ``options_map` to pass to ``extract_from_dir``
  
      This is the options_map that's used to generate a Jinja2 environment. We
      want to generate and environment for extraction that's the same as the
      environment we use for rendering.
  
      This allows developers to explicitly set a ``JINJA2_CONFIG`` in settings.
      If that's not there, then this will pull the relevant bits from the first
      Jinja2 backend listed in ``TEMPLATES``.