I want to send this list as JSON in the Flask framework.
I fetched something from my DB and I have this here as my list:
[('GG',)]
How do I send it to JSON?
@app.route('/gt', methods=['GET'])
def gt():
logged_in_email = session['auth']
if not logged_in_email:
return "Nothing"
else:
r = todo.retrieve_todo(logged_in_email)
print(r)
print(type(r))
return r
This doesn't work, I tried json.loads
but that expects a string and I have a list?