我可以使用mod_wsgi用apache部署python 2和3 django应用程序吗? [英] Can I deploy both python 2 and 3 django app with apache using mod_wsgi?
问题描述
我正在ubuntu 14.04上运行.我想知道我是否可以部署用python 2和3以及apache和mod_wsgi编码的django应用程序?以及如何?
I am running on ubuntu 14.04. And I am wondering can I deploy my django apps coded with python 2 and 3 together with apache and mod_wsgi? and how?
推荐答案
不,您不能. Apache的mod_wsgi模块仅针对一个Python版本进行编译.您不能同时将多个mod_wsgi实例加载到Apache中.
No you cannot. The mod_wsgi module for Apache is compiled for one Python version only. You cannot load more than one instance of mod_wsgi into Apache at the same time.
您可能会做的更好的是使用mod_wsgi-express,它允许通过mod_wsgi以更简单的方式运行Apache,而mod_wsgi是您的Python安装或虚拟环境的一部分.然后,您可以使任何前端Web服务器代理到不同的mod_wsgi-express实例,每个实例都使用不同的Python版本.
What you may be better off doing is using mod_wsgi-express, which allows running of Apache with mod_wsgi in a more easy way where mod_wsgi is a part of your Python installation or virtual environment. You could then have any front end web server proxy to different mod_wsgi-express instances where each is using different Python versions.
请参阅:
还请返回并阅读过去的mod_wsgi文章,这些文章在我的博客网站上都讨论过mod_wsgi-express和proxy的内容:
Also go back and read through past mod_wsgi articles where I have talked about mod_wsgi-express and proxying on my blog site:
这篇关于我可以使用mod_wsgi用apache部署python 2和3 django应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!