Requests not able call multiple routes in same Flask application Requests not able call multiple routes in same Flask application flask flask

Requests not able call multiple routes in same Flask application


Your code assumes that your app can handle multiple requests at once: the initial request, plus the request that is generated while the initial is being handled.

If you are running the development server like app.run(), it runs in a single thread by default; therefore, it can only handle one request at a time.

Use app.run(threaded=True) to enable multiple threads in the development server.


As of Flask 1.0 the development server is threaded by default.