python - “环境:生产”对 python-eve 意味着什么?
问题描述
我按照快速入门指南创建了一个简单的 Eve 应用程序。在控制台中,我看到了以下消息。
* Serving Flask app "eve" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
...
我检查了文档的开发/生产部分,但可以找到任何提到该Environment
设置的地方。更具体地说,我无法弄清楚:
- eve 如何决定环境是处于开发阶段还是生产阶段?
- 除了提供的设置,eve 应用程序是否将不同的设置应用于不同的环境?
- 我可以从设置中更改环境名称吗?例如环境: docker-dev。
解决方案
Flask comes with a built-in web server to allow you to test your work but it is not secure or robust enough to run a live system that will be exposed to the public. For that you should deploy your Flask app using a full-strength server. Instructions are available on the Flask website. Personally I like Gunicorn.
https://flask.palletsprojects.com/en/1.1.x/deploying/wsgi-standalone/
推荐阅读
- elasticsearch - 如何使用多重匹配查询获得一半的搜索词?
- python-3.x - 用于序列估计的多通道 LSTM - 寻求建议
- python - 尝试使用 mysql-connector-python 库的 Python 错误
- excel - 如何使用树字母在 excel 中生成公式,然后使用 ID 编号
- javascript - 如何将数据从我的 main.js 发送到我的 index.html(电子)
- javascript - 这个正则表达式代码是如何工作的(积极的前瞻)?
- git - 使用来自 Jenkins 的凭据在 shell 脚本中进行 git clone
- django - 类型对象 'MODEL' 没有属性 'USERNAME_FIELD'
- node.js - 为什么在我尝试安装 Node.js 时会出现此消息?
- r - 安装后无法加载 kableExtra