Skip to main content
 首页 » 编程设计

python之在同一台服务器上使用 python 2 和 python 3 的 WSGI 应用程序

2025年05月04日9pander-it

我已经有一个用 Python 2 编写的 Web 应用程序,它运行在 WSGI(特别是 OpenERP Web 服务器)上。

我想编写一个新的 Web 应用程序,它可以在同一台服务器(Ubuntu 上的 Apache 2)上运行,但使用 WSGI 和 Python 3。这两个应用程序将位于不同的端口上。

这可能吗?

请您参考如下方法:

不,使用 mod_wsgi 是不可能的(参见此处:https://github.com/GrahamDumpleton/mod_wsgi/issues/21 和此处:https://serverfault.com/questions/599859/multiple-python-versions-under-apachemod-wsgi)

这篇文章还提供了一个替代方案:使用 nginx。