背景
有一個 Flask 項目,然后有一個路由返回的是 dict
通過瀏覽器訪問,結果報錯
關鍵報錯信息
TypeError: 'dict' object is not callable The view function did not return a valid response. The return type must be a string, tuple, Response instance, or WSGI callable, but it was a dict.
意思是不能返回 dict
解決方案
結果是版本太老了,用的 Flask 1.0.2....我服了,之前跑別人的項目裝了個老版 Flask,裝個最新版本就好了...