Объясните пожалуйста почему код выдаёт ошибку (не находит index.html)

введите сюда описание изображения ``` from jinja2 import Environment, FileSystemLoader

persons = [
    {'name':'Max', 'old':'14', 'weight':'160'},
    {'name':'Alex', 'old':'15', 'weight':'180'},
    {'name':'Misha', 'old':'13', 'weight':'170'}
]

file_loader = FileSystemLoader('templates')
env = Environment(loader=file_loader)
tm = env.get_template('index.html')
msg = tm.render(user=persons)

print(msg)
```

Вот html

<pre>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {% if title -%}
        <title>pro Flask - {{ title }}</title>
    {% else -%}
        <title>pro Flask</title>
    {% endif %}
</head>
<body>
    <!-- {% macro list_users(users) %}
    {% for i in users %}
        <ul>
            <li>{{i.name}} {{caller(i)}}
        </ul>
    {% endfor %}
{% endmacro %}

{% call(users) list_users(user) %}
    <ul>
        <li>age: {{users.old}}
        <li>weight: {{users.weight}}
    </ul>
{% endcall %} -->
{% for u in user %}
    <ul>
       <li>
           {{u.name}}
       </li> 
    </ul>
{% endfor %}
</body>
</html>
</pre>

Вот ошибка

Traceback (most recent call last): File "c:\Users\User\Desktop\programming on C\django_web_site\flask_web\flask_code\app.py", line 13, in tm = env.get_template('index.html') File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\jinja2\environment.py", line 997, in get_template
return self._load_template(name, globals) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\jinja2\environment.py", line 958, in _load_template template = self.loader.load(self, name, self.make_globals(globals)) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\jinja2\loaders.py", line 125, in load source, filename, uptodate = self.get_source(environment, name) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\jinja2\loaders.py", line 214, in get_source raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: index.html


Ответы (0 шт):