Monday, November 3, 2014

Re: Multiple versions of python on linux server

On 03/11/14 15:46, robert brook wrote:
This is the first time that I am having apache configured to run django

I plan on using mod_wsgi on apache and linux  using 2 servers, the apache server and the application server.

The linux (red hat 6) / django server had python 2.6 installed for admin purposes out of the box..
Go figure, 2.6 has to be 10 years old.

When you type in python,  the 2.6 version runs.

We added python 3.3 to install all of the packages to run the application.

I am able to launch the local dev server with python 3.3 after running a script to initiate python 3.3

I will have apache point to the wsgi.py file for the django application.
But how will apache know to implement python3.3

If I am missing something let me know, I am new at this production implementation.

Thanks

Robert,

You have to use a mod_wsgi that is built against python3. On Debian/Ubuntu, the package is called libapache2-mod-wsgi-py3.

On the matter of virtualenvs, I would still encourage their use so that you have per-application flexibility later, and you are not forced later to wrestle with python package dependency conflicts between your apps, or between an app and the operating system.

John

No comments:

Post a Comment