按照文档,首先写一个test.py的文件,进行测试是否安装成功

def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    return [b"Hello World"] # python3
 

结果页面显示Internal Server Error

控制台显示no python application found, check your startup logs for errors

重新查看手册,发现,需要在命令行添加参数 --plugin python

执行下面命令行:

uwsgi --plugin python --http :8001 --wsgi-file test.py

重新访问 localhost:8001

就可以看到 成功的显示了 ‘Hello world’

PS:附件为uwsgi的手册

https://media.readthedocs.org/pdf/uwsgi-docs-additions/latest/uwsgi-docs-additions.pdf

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐