Warning message while running Flask

后端 未结 9 1546
有刺的猬
有刺的猬 2020-12-07 13:07

While I am running Flask code from my command line, a warning is appearing:

Serving Flask app \"hello_flask\" (lazy loading)
* Environment: production
  WARN         


        
9条回答
  •  暖寄归人
    2020-12-07 14:08

    As stated in the Flask documentation:

    While lightweight and easy to use, Flask’s built-in server is not suitable for production as it doesn’t scale well and by default serves only one request at a time.

    Given that a web application is expected to handle multiple concurrent requests from multiple users, Flask is warning you that the development server will not do this (by default). It recommends using a Web Server Gateway Interface (WSGI) server (numerous possibilities are listed in the deployment docs with further instructions for each) that will function as your web/application server and call Flask as it serves requests.

提交回复
热议问题