我在PyCharm社区版中安装了Flask插件,并且我的flask应用程序中只有这个简单的代码:
我在PyCharm Community Edition中安装了Flask插件,而我的Flask应用程序中只有这段简单的代码:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return '<h1>Hello!</h1>'
if __name__ == "__main__":
app.run(debug=True)
然后我收到了这个消息:
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead
* Restarting with stat
* Debugger is active!
* Debugger PIN: 123-456-789
* Running on http://127.0.0.1:5000/
当我运行Flask时为什么会出现这个错误?
之前的版本消息是“不要在生产环境中使用开发服务器。”
serve(app, host="0.0.0.0", port=8080)
和waitress-serve --call flaskr:create_app
有什么区别?你更喜欢哪一个? - Michaelwaitress-serve
只是一个方便的命令行运行器。个人而言,我更喜欢前者,因为它有更多的文档记录。 - Yuchen