Flask Accessing an interface that returns a dictionary error: 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.

background

There is a flask project, and then a route returns dict

When accessed through the browser, an error is reported

Key error message

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.

It means that dict cannot be returned

Solution

The result is that the version is too old. I used flash 1.0.2… I took it. I ran other people’s projects and installed an old version of flash. Just install the latest version

Similar Posts: