Flask框架app.route返回参数报错
报错信息: TypeError: The view function did not return a valid response. The return type must be a string, dict, tuple, Response instance, or WSGI callable, but it was a list.
这个错误翻译后是:视图函数没有返回有效的响应。返回类型必须是字符串、字典、元组、响应实例或WSGI可调用对象,但它是一个列表。
原因是我从数据库查出数据后直接返回给前端了
后来将返回值转换为json就可以了,使用jsonify进行转换