Ao executar o código da aula 2 (Formulário de cadastro de jogo) recebi um status 500, poderiam me auxiliar com este erro, por favor
Erro :
[2019-03-11 08:35:25,481] ERROR in app: Exception on /novo [GET]
Traceback (most recent call last):
File "C:\Users\Robson Souza\AppData\Local\Programs\Python\Python37-32\lib\site-packages\flask\app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\Robson Souza\AppData\Local\Programs\Python\Python37-32\lib\site-packages\flask\app.py", line 1816, in full_dispatch_request
return self.finalize_request(rv)
File "C:\Users\Robson Souza\AppData\Local\Programs\Python\Python37-32\lib\site-packages\flask\app.py", line 1831, in finalize_request
response = self.make_response(rv)
File "C:\Users\Robson Souza\AppData\Local\Programs\Python\Python37-32\lib\site-packages\flask\app.py", line 1949, in make_response
'The view function did not return a valid response tuple.'
TypeError: The view function did not return a valid response tuple. The tuple must have the form (body, status, headers), (body, status), or (body, headers).
Código Jogoteca :
from flask import Flask, render_template
from domain.domains import Jogo
app = Flask(__name__)
def jogos_padrao():
return [
Jogo('Tetris', 'Arcade', 'Atari'),
Jogo('Mario', 'Plataforma', 'SNES'),
Jogo('Pokemon Lets Go', 'RPG', 'Switch')
]
@app.route('/home')
def home():
lista_jogos = jogos_padrao()
return render_template('lista.html', titulo='JOGOS', jogos=lista_jogos)
@app.route('/novo')
def novo():
return render_template('cadastro.html', titulo='Novo Jogo'),
def main():
app.run()
if __name__ == '__main__':
main()
Código Cadastro HTML :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Jogoteca</title>
</head>
<body>
<div class="container">
<div class="page-header">
<h1>{{ titulo }}</h1>
</div>
<form>
<fieldset>
<div class="form-group">
<label for="nome">Nome</label>
<input type="text" id="nome" name="nome" class="form-control">
</div>
<div class="form-group">
<label for="categoria">Categoria</label>
<input type="text" id="categoria" name="categoria" class="form-control">
</div>
<div class="form-group">
<label for="console">Console</label>
<input type="text" id="console" name="console" class="form-control">
</div>
<button type="submit" class="btn btn-primary btn-salvar">Salvar</button>
</fieldset>
</form>
</div>
</body>
</html>