环境搭建(因为window下不支持uwsgi的安装,故在Linux-centos下尝试环境搭建)html
pip install uwsgi
编写test.py脚本测试是否安装成功python
def application(env,start_response): start_response('200 Ok',[('Content-Type','text/html')]) return [b"hello world"]
uwsgi --http :8001 --wsgi-file test.py
注意:若执行该命令时报错bash: uwsgi: command not found,解决办法是建立软连接:ln -s /usr/local/python3/bin/uwsgi /usr/bin/uwsgi
浏览器访问:http://10.1.1.71:8001/ 看到以下界面则证实 uwsgi 安装成功centos