![](/img/trans.png)
[英]How to capture STDOUT of a Python process running under IIS, FastCGI, and WSGI?
[英]FastCGI WSGI library in Python 3?
对于Python 3,是否存在可以作为FastCGI服务器为WSGI应用程序提供服务的库? (那么nginx可以代理请求吗?)
Python 3文档提到了flup ,但是flup甚至没有安装在Python 3中:
% env3/bin/pip install flup Downloading/unpacking flup Downloading flup-1.0.2.tar.gz (49kB): 49kB downloaded Running setup.py (path:/Users/me/tmp/env3/build/flup/setup.py) egg_info for package flup Traceback (most recent call last): File "", line 17, in File "/Users/me/tmp/env3/build/flup/setup.py", line 2, in from ez_setup import use_setuptools File "./ez_setup.py", line 98 except pkg_resources.VersionConflict, e: ^ SyntaxError: invalid syntax Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 17, in File "/Users/me/tmp/env3/build/flup/setup.py", line 2, in from ez_setup import use_setuptools File "./ez_setup.py", line 98 except pkg_resources.VersionConflict, e: ^ SyntaxError: invalid syntax ---------------------------------------- Cleaning up... Command python setup.py egg_info failed with error code 1 in [snip] Storing debug log for failure in [snip]
现在有一个名为flup6
模块。 使用pip
安装它
./pip install flup6
你可以使用触发器 。 它是一个简化的flup分支(仅包含FastCGI部分),并且可以与Python 3一起使用。
您可以使用flup-py3
来解决此问题,如下所示:
pip3 install flup-py3
您可能需要超级用户权限才能执行此命令。
我知道有两种选择
两者都支持Python 3,并且两者都可以基于其他Web应用程序代码创建WSGI工作程序,并且可以提供给NGINX。
正如Graham Dumpleton所说,CherryPy通过HTTP协议与NGINX对话,而uWSGI将'uwsgi'协议与nginx而不是HTTP协议进行对话,尽管它也支持使用HTTP。 在应用程序方面,它们都支持通过WSGI API托管Python Web应用程序。
flipflop
pip3 install --upgrade flipflop
flipflop
是我的诀窍。 flup-py3
有一个尚未解决的问题 ,现在已经开放了几年。
不要忘记编辑 .fcgi
脚本中的导入行以反映使用flipflop
这一变化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.