def _get_jinja_environment():
    current_dir = os.path.dirname(__file__)
    templates_dir = os.path.join(current_dir, '../templates')
    return jinja2.Environment(loader=jinja2.FileSystemLoader(templates_dir),
                              extensions=['jinja2.ext.autoescape'],
                              autoescape=True)