Django setup

         · ·     

Over the last few days I have been playing with Django quite alot, installing it on a couple of machines and on Dreamhost. The Dreamhost configuration is now well documented by Jeff Croft in his post: http://www2.jeffcroft.com/2006/may/11/django-dreamhost/ and the on Dreamhost Wiki here: http://wiki.dreamhost.com/index.php/Django

I did seem to use a few different settings on the file:

django.fcgi:

#!/usr/bin/env python import sys sys.path += ['/home/timc3/django/django_src'] sys.path += ['/home/timc3/django/django_projects'] from fcgi import WSGIServer from django.core.handlers.wsgi import WSGIHandler import os os.environ['DJANGO_SETTINGS_MODULE'] = 'drunkonpetrol.settings' WSGIServer(WSGIHandler()).run()

Which seemed to help no end in getting it working.

On my own development machines I have had to set the PYTHONPATH environmental variable in .profile which is what python uses to search along when doing its imports. This is also set when using Mod_Python in the VirtualHost settings of Apache.

DJANGO_SETTINGS_MODULE is another env var that can be set this time for django itself. I haven’t yet configured it on my machines at the moment but I will do no doubt.

The base configuration that django gives via its admin tools is very good, but it has been extended by this project: Nesh DjangoUtils , which helps when setting up a djangoproject to do everything from creating the directories to creating the fcgi and modpython entries.  I haven’t needed to use it yet as I already started my django project before using it, but it is one to try in the future for sure.

So far I am finding django quite rapid in development, but I am spending alot of time looking for documentation on things, but the IRC channel is proving invaluable for help.  I will be putting up alot more articles as I go forward.

comments powered by Disqus