This post will show how to get running with Django on Solaris 10 with the Sun GlassFish Web Stack.

Install Web Stack

First, get the GlassFish Web Stack from here. Depending on how you want to install the Web Stack, choose either the Image Packaging System (IPS) or the native package format. For more details on the installation, see Sriram's Blog. This post assumes the native version, but can easily be modified for the IPS delivery.

Build mod_wsgi

/usr/sfw/bin/wget /usr/sfw/bin/gtar xfz mod_wsgi-2.5.tar.gzcd mod_wsgi-2.5 ./configure --with-apxs=/opt/webstack/apache2/2.2/bin/apxs --with-python=/opt/webstack/python/bin/python Before you run make, be sure that /usr/ccs/bin and the C compiler, in this case Sun Studio Express, /opt/SSX0903/bin, are in your path. We also need to explicitly set the rpath.

LD_RUN_PATH=/opt/webstack/python/lib makemake install This will put the library in /opt/webstack/apache2/2.2/libexec/

Setup Django

/usr/sfw/bin/wget xfz Django-1.1.tar.gzcd Django-1.1/opt/webstack/python/bin/python install Now, let's create a sample project.

cd /export/home/overstre/opt/webstack/python/bin/python /opt/webstack/python/lib/python2.6/site-packages/django/bin/ startproject mysite We now need to tell Django that we will be using WSGI.

cd mysite; mkdir apachecat > django.wsgi > /etc/opt/webstack/apache2/2.2/conf.d/modules-32.load And now we need to setup a simple wsgi.conf file so Apache knows about the Django project we created in the previous section.

cat > /etc/opt/webstack/apache2/2.2/conf.d/wsgi.conf