参考文章 https://blog.csdn.net/yang9520/article/details/79740374
Flask是由python实现的一个web微框架,让我们可以使用Python语言快速实现一个网站或Web服务。
安装flask
pip3 install flask
创建一个hello.py文件
[root@xunjian flask_uwsgi]# cat hello.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_flask():
return 'Hello Flask!!'
if __name__ == '__main__':
app.run(host='0.0.0.0',port=5000)
运行hello.py
[root@xunjian flask_uwsgi]# python3 hello.py
* Serving Flask app "hello" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
网友评论