Before you do anything else, if you intend to use the admin feature in Django, make sure you go to your httpd.conf file and comment out this line:
LoadModule php5_module libexec/apache2/libphp5.soFor some reason mod_python.so and libphp5.so do not play nice together when it comes to the admin section of Django. If some kind person could either explain why or direct me to a site that has an explanation, that would be great.
django can be found at - http://www.djangoproject.com/
I downloaded the svn version. Usually, I end up with several different versions. My django directory typically looks like this:
I simply rename the trunks according to their version number and symlink ln -s ./django-trunk ./trunk_whatever This way, when I set up the symlink in the site-package directory to the django install, it is set up to the symlink django-trunk, which itself is linked to whichever trunk I happen to be using.
To link to the site-packages directory, do the following two commands:
SITE_PACKAGES_DIR=`python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`
ln -s `pwd`/django-trunk/django $SITE_PACKAGES_DIR/django
Very good, now setting up apache.
Leopard is a bit quirky, but I want to use their way of doing things if at all possible. Here are some links to get around various problems:
kevin covers some basics on virtualhosting
aking discusses an important quirk to get multiple virtual host names working
I do my work on localhost, so my /etc/hosts file looks like:
127.0.0.1 localhost site1.dev something.whatever
then in my httpd-vhosts.conf file I have:
<VirtualHost 127.0.0.1 >
<VirtualHost * >
<Location "/" >
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
There are a few points to keep in mind
- I'm assuming you are using the django tutorial, so I named it "mysite". mysite.settings is used with the DJANGO_SETTINGS_MODULE
- if I wanted the DocumentRoot for something.whatever to be "/Users/tickletik/Sites" then I would have had to set Location to < Location "/mysite/" > DO NOT forget both slashes!