I’ve re-imaged my server for Centos 6, specifically so I could install and run Django which requires Python 2.6 or later. I have it configured for one virtual host, my mom’s web site- http://santfineart.com/ which I’ve turned into a very simple database driven art work display. A bit of JQuery and it works pretty well. A more in depth description can be found on the Django page link on the right.

I like Django ok, (it is python after all), but as I tend toward minimalistic designs, much of what I found online in terms of examples and demos was way way overkill.  So I pared things back quite a bit for this site and am quite pleased with the outcome.  Of course, it needs more content and I will be uploading that as I can, but the framework is there and works very reliably.

One thing that was a bit of a mystery at first was how to configure apache to run just one virtual host with Django.  There was also the problem where to serve the static css and other content from, as the Django docs are a bit confusing on this.  What I did was add aliases to the virtual config so everything gets sourced from the same place as the view templates.  Like this:

WSGIPythonPath /home/santfineart/artwork

<VirtualHost santfineart.com:80>
<Directory "/home/santfineart">
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
DocumentRoot "/home/santfineart"
ServerName santfineart.com
WSGIScriptAlias / /home/santfineart/artwork/artwork/wsgi.py
ServerAlias *.santfineart.com
Alias /static/admin/css /usr/lib/python2.6/site-packages/django/contrib/admin/static/admin/css/
Alias /static/admin/img /usr/lib/python2.6/site-packages/django/contrib/admin/static/admin/img/
Alias /static_css/ /home/santfineart/artwork/templates/
Alias /images/ /home/santfineart/images/
</VirtualHost>

If you would like to take a look at the Django source for this site, I’ve zipped it up django-code.zip

link