Flask app get “IOError: [Errno 32] Broken pipe”

后端 未结 1 1929
孤城傲影
孤城傲影 2020-12-31 02:43

Now I use flask to develop web app.

But at first it works well,after operating web page for a while,the flask back-end shows error like these:

   Fil         


        
相关标签:
1条回答
  • 2020-12-31 03:32

    The built-in werkzeug server is not capable of handling the remote end closing the connection while the server is still churing its content out.

    instead of app.run(debug=True,port=5000)

    try

    from gevent.wsgi import WSGIServer
    http_server = WSGIServer(('', 5000), app)
    http_server.serve_forever()
    

    or if you are using nginx, use it with uwsgi as described here

    It is rather a werkzeug issue I would argue

    0 讨论(0)
提交回复
热议问题