gpt4 book ai didi

python - 运行 Flask 时出现警告消息

转载 作者:IT老高 更新时间:2023-10-28 21:32:56 36 4
gpt4 key购买 nike

当我从命令行运行 Flask 代码时,出现警告:

Serving Flask app "hello_flask" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.

这是什么意思?

最佳答案

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.

鉴于 Web 应用程序需要处理来自多个用户的多个并发请求,Flask 警告您开发服务器不会这样做(默认情况下)。它建议使用 Web Server Gateway Interface (WSGI) server ( numerous possibilities are listed in the deployment docs with further instructions for each ) 将充当您的 Web/应用程序服务器并在处理请求时调用 Flask。

关于python - 运行 Flask 时出现警告消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50284753/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com