应用程序 A 使用 Python 2.5 和 Django 编写,并通过 mod_wsgi 在 Apache 服务器上运行。
应用程序 B 是用 Python 2.7 编写的,我希望它在同一台服务器上并行运行。
我不想将应用 A 更新为使用 2.7,或将应用 B 更改为使用 2.5。
问题:
Can I run two Django apps with two separate Python runtimes side-by-side on one Apache server?
If I can, how do I set this up?
这让我很困惑,因为 WSGI 文档 offers a Python “home” setting而this document说 mod_wsgi
必须针对特定版本的 Python 进行编译:
Note that the version of Python from which this baseline environment is created must be the same version of Python that mod_wsgi was compiled for. It is not possible to mix environments based on different major/minor versions of Python.
这是否意味着我无法同时运行 2.5 和 2.7 Django 应用程序?
最佳答案
正确,你“不能同时运行 2.5 和 2.7 Django 应用程序”。这不可能。您能做的最好的事情就是让应用程序在不同的虚拟环境中运行,但所有虚拟环境都适用于编译 mod_wsgi 的相同 Python 版本。
关于python - 我可以在 Python 2.7 上运行一些 mod_wsgi 应用程序,而将其余应用程序保留在 Python 2.5 上吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7854203/