Olá quando tento entrar na pagina da aplicação acontece o seguinte erro "Internal Server Error"
erro no terminal:
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [06/Feb/2021 03:33:17] "GET / HTTP/1.1" 404 -
[2021-02-06 03:33:23,403] ERROR in app: Exception on /inicio [GET]
Traceback (most recent call last):
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/main.py", line 8, in oi
return render_template('lista.html', titulo='Jogos', jogos=lista)
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/flask/templating.py", line 133, in render_template
return _render(ctx.app.jinja_env.get_or_select_template(template_name_or_list),
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/jinja2/environment.py", line 930, in get_or_select_template
return self.get_template(template_name_or_list, parent, globals)
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/jinja2/environment.py", line 883, in get_template
return self._load_template(name, self.make_globals(globals))
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/jinja2/environment.py", line 857, in _load_template
template = self.loader.load(self, name, globals)
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/jinja2/loaders.py", line 127, in load
code = environment.compile(source, name, filename)
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/jinja2/environment.py", line 638, in compile
self.handle_exception(source=source_hint)
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/venv/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/wallafi/Área de Trabalho/aws/pythonWeb/jogoteca/templates/lista.html", line 20, in template
{{% for jogo in jogos %}}
jinja2.exceptions.TemplateSyntaxError: unexpected '%'
127.0.0.1 - - [06/Feb/2021 03:33:23] "GET /inicio HTTP/1.1" 500 -
Meu codigo:
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/inicio')
def oi():
lista = ['fifa', 'gta', 'red dead']
return render_template('lista.html', titulo='Jogos', jogos=lista)
app.run()