Quando tenta inserir um novo jogo no banco de dados, recebo esse erro de volta:
Traceback (most recent call last): File "/home/john/PycharmProjects/jogoteca/venv/lib/python3.7/site-packages/flask/app.py", line 1997, in call return self.wsgi_app(environ, start_response)
File "/home/john/PycharmProjects/jogoteca/venv/lib/python3.7/site-packages/flask/app.py", line 1985, in wsgi_app response = self.handle_exception(e)
File "/home/john/PycharmProjects/jogoteca/venv/lib/python3.7/site-packages/flask/app.py", line 1540, in handle_exception reraise(exc_type, exc_value, tb)
File "/home/john/PycharmProjects/jogoteca/venv/lib/python3.7/site-packages/flask/_compat.py", line 33, in reraise raise value
File "/home/john/PycharmProjects/jogoteca/venv/lib/python3.7/site-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request()
File "/home/john/PycharmProjects/jogoteca/venv/lib/python3.7/site-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e)
File "/home/john/PycharmProjects/jogoteca/venv/lib/python3.7/site-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb)
File "/home/john/PycharmProjects/jogoteca/venv/lib/python3.7/site-packages/flask/_compat.py", line 33, in reraise raise value
File "/home/john/PycharmProjects/jogoteca/venv/lib/python3.7/site-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request()
File "/home/john/PycharmProjects/jogoteca/venv/lib/python3.7/site-packages/flask/app.py", line 1598, in dispatch_request return self.view_functionsrule.endpoint
File "/home/john/PycharmProjects/jogoteca/jogoteca.py", line 50, in criar jogo_dao.salvar(jogo)
File "/home/john/PycharmProjects/jogoteca/dao.py", line 21, in salvar cursor.execute(SQL_CRIA_JOGO, (jogo.nome, jogo.categoria, jogo.console))
File "/home/john/PycharmProjects/jogoteca/venv/lib/python3.7/site-packages/MySQLdb/cursors.py", line 209, in execute res = self._query(query)
File "/home/john/PycharmProjects/jogoteca/venv/lib/python3.7/site-packages/MySQLdb/cursors.py", line 315, in _query db.query(q)
File "/home/john/PycharmProjects/jogoteca/venv/lib/python3.7/site-packages/MySQLdb/connections.py", line 226, in query _mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1046, 'No database selected')
O que está acontecendo? podem me ajudar?