python - 我可以在 Python 2.7 上运行一些 mod_wsgi 应用程序,而将其余应用程序保留在 Python 2.5 上吗?

标签 python django apache mod-wsgi virtualenv

应用程序 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” settingthis documentmod_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/

相关文章:

python - Django 源代码不会在服务器上更新

apache - apache .htaccess 中的主题标签

python - 不确定如何将数字设置为变量 python 以及如何让机器人注意到每条消息

python - 无效请求错误 : VARCHAR requires a length on dialect mysql

python - 使用户制作的 HTML 模板安全

jquery - django:csrf_token用于单个页面上的多个表单和ajax请求

python - 识别文章中的实体

python - Django、JSONField、Postgres 和 F() 对象比较

django - django表单提交后触发引导模式

Apache Web 服务器和 JBoss AJP 与 https 的连接