Python 为什么可以';我不能从sqlite3上的数据库中删除吗?

Python 为什么可以';我不能从sqlite3上的数据库中删除吗?,python,sqlite,Python,Sqlite,我得到的错误是: 127.0.0.1:5002/delete/1 看起来您在cur.execute行中的字符串后面和(id,)之前缺少一个逗号。尝试使用以下命令 File "api_calls.py", line 65, in remove cur.execute('Delete from query_database where id == ?' (id,)) TypeError: 'str' object is not callable 127.0.0.1 - - [03/Sep/

我得到的错误是:

127.0.0.1:5002/delete/1

看起来您在
cur.execute
行中的字符串后面和(id,)之前缺少一个逗号。尝试使用以下命令

File "api_calls.py", line 65, in remove
    cur.execute('Delete from query_database where id == ?' (id,))
TypeError: 'str' object is not callable
127.0.0.1 - - [03/Sep/2018 18:33:56] "POST /delete/1 HTTP/1.1" 500 -

使用Django,要删除服务器内的数据库,需要删除模型,然后运行migrate和makemigrations。 要删除记录,您需要通过表单和post请求。 希望这会有帮助

File "api_calls.py", line 65, in remove
    cur.execute('Delete from query_database where id == ?' (id,))
TypeError: 'str' object is not callable
127.0.0.1 - - [03/Sep/2018 18:33:56] "POST /delete/1 HTTP/1.1" 500 -
cur.execute('Delete from query_database where id == ?', (id,))