Django installation on RHEL

March 16, 2012 by · Leave a Comment
Filed under: Uncategorized 

Since the yum install Django works with python2.4, if you want to use python 2.6, you have to manually do it. Get the latest Django, unzip it, and create a symlink from where you unzipped it to /usr/lib64/python2.6/site-packages, which is where python26 is going to look for it

ln -s /where/i/unzipped/Django-1.3.1/django /usr/lib64/python2.6/site-packages/

mod_wsgi, Python 2.6, and RHEL 5

March 16, 2012 by · Leave a Comment
Filed under: Uncategorized 

To get mod_wsgi working with python26 on RHEL 5,
yum install python26-mod-python

Then in httpd.conf, instead of
LoadModule wsgi_module modules/mod_wsgi.so

use
LoadModule wsgi_module modules/python26-mod_wsgi.so

elsewhere in httpd.conf, you van have:
WSGIScriptAlias /projbase /var/lib/django/projbase.wsgi

with /var/lib/django/projbase.wsgi

#/var/lib/django/projbase.wsgi

import os
import sys

sys.path = ['/var/www/', '/usr/lib64/python2.6'] + sys.path
from django.core.handlers.wsgi import WSGIHandler

os.environ['DJANGO_SETTINGS_MODULE'] = 'pytest.settings'
application = WSGIHandler()