I forked the Flask example, Minitwit, to work with MongoDB and it was working fine on Flask 0.9, but after upgrading to 0.10.1 I get the error in title when I login when I try to set the session id.
It seems there was changes in Flask 0.10.1 related to json.
Code snippet:
user = db.minitwit.user.find_one({'username': request.form['username']})
session['_id'] = user['_id']
Full code in my github repo.
Basically, I set the Flask session id to the user's _id from MongoDB.
I tried the first two solution from this SO question without success.
Well, doing session['_id'] = str(user['_id']) gets rid of the error message and I'm properly redirected to the timeline page but I am not actually logged in.
How can I fix this?
EDIT: Copy/paste of the traceback: http://pastebin.com/qa0AL1fk
Thank you.