参考链接 :https://www.cnblogs.com/wswang/p/5521566.html
环境:
OS:Mac10.12.6
Server:uWSGI 2.0.18
1.1 创建一个test.py文件:
# test.py
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return [b"Hello World"] # python3
#return ["Hello World"] # python2
1.2 启动uWSGI服务器:
uwsgi --http :8000 --wsgi-file test.py
意思是使用8000端口启动这个文件,效果如下:
(py3_test_venv) shejishi03deiMac:Test shejishi03$ uwsgi --http :8000 --wsgi-file test.py
*** Starting uWSGI 2.0.18 (64bit) on [Wed Jan 1 12:38:48 2020] ***
compiled with version: 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2) on 14 No