Skip to content Skip to sidebar Skip to footer

'sqlite3.cursor' Object Has No Attribute '__getitem__' Error In Python Flask

This is my code. I get this error everytime I press login: 'sqlite3.Cursor' object has no attribute '__getitem__' This is my login tab: @app.route('/', methods=['GET', 'POST']) def

Solution 1:

__getitem__ refers to square bracket access, in this case data[0]. The error tells you that you can't use cursors like that. Replace data[0] with the value returned from data.fetchone().


Post a Comment for "'sqlite3.cursor' Object Has No Attribute '__getitem__' Error In Python Flask"