WSGI apps with python 2 and python 3 on the same server?

萝らか妹 提交于 2021-02-08 19:49:35

问题


I already have a web application in written in Python 2 that runs over WSGI (specifically, OpenERP web server).

I would like to write a new web application that would run on the same server (Apache 2 on Ubuntu), but using WSGI and Python 3. The two applications would be on different ports.

Is that possible?


回答1:


No, it is not possible with mod_wsgi (see here: https://github.com/GrahamDumpleton/mod_wsgi/issues/21 and here: https://serverfault.com/questions/599859/multiple-python-versions-under-apachemod-wsgi)

This post also provides an alternative: using nginx.




回答2:


Its quite possible. This is what virtualenv as all about. Set up the second app in a virtualenv , with python3 .

You an add it in a virtualhost configuration in apache.



来源:https://stackoverflow.com/questions/14375520/wsgi-apps-with-python-2-and-python-3-on-the-same-server

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!