tags:

views:

49

answers:

2

I have a RH system running RHEL 5.3, which comes with python2.4 that can't be removed for numerous reasons.

I have been able to build 64-bit RPMS for python 2.6 as an altinstall. It's called with "python26".

How can I tell Django to use this command to get to the proper python version, instead of the default "python".

I can, of course, change the symlink in /usr/bin manually, but i'm looking to fully automate the buildout of these systems, and I'm almost certain this is possible.

Thanks.

+1  A: 

Look at virtualenv, you can setup your own environment for django (well, anything) with different lib versions, symlinks etc.

Dmitry Shevchenko
That doesn't help with different python versions.
nosklo
Łukasz
Commenters are both half right. It can help if you are running command line Python, for example if running Django development server, and install Django in that virtual environment. It will not help if using mod_python or mod_wsgi as they are explicitly linked against Python run time and you can't just point them at a virtual environment for a different Python version and instead have to recompile mod_python or mod_wsgi to link to the desired version.
Graham Dumpleton
Thank you Mr. Dumpleton. That gives me the info I need. A new mod_wsgi RPM pointing to the correct python...
jduncan
+2  A: 

That depends on the deploying method you use. E.g., if you use the django-recommended mod_wsgi deployment, then you must compile it with the correct python version.

nosklo
I ended up rolling out a new RPM for mod_wsgi pointing it to the proper Python install.
jduncan