enter image description here

Hello: while registering int object not subscriptable error coming, even though i truncate [0] from results. Any thoughts

1 Answer 1


Are you sure both session and results are dicts?

  • Correct me, through results["id"] we will access id (primary key) of the table in the database and this will bes saved under session ["user_id"]. As per what i know session in flask is a dictionary. As the property of dictionry is it has key value pairs, so how to confirm whether results is dictionary,? as debug mode is off. Thanks for your time Jan 2, 2020 at 9:32
  • @MannawarHussain I would print both values and double-check if that's true.
    – kzidane
    Jan 2, 2020 at 13:42
  • i tried to print the values for both by inserting statements (print(session) & print(results)) inside register route, sorry could not insert screenshot here, and then do flask run but it is not printing any values, and also couldnot do python application.py Kindly advice Jan 3, 2020 at 6:33
  • Thanks Kareem its done now Jan 3, 2020 at 7:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .