Installing Django on OSX Tiger 10.4 INTEL

Posted by Joel Jensen Sun, 18 Jun 2006 15:26:00 GMT

Here are some tips for installing django on OSX Tiger Intel


Enable the root user

  • Applications >> Utitlities >> Net Info
  • Security drop down
  • Authencicate
  • Security drop down
  • Enable root user

Install this, it will save your sanity. It adds a shortcut to the terminal from any finder window. open terminal here

(HINT) to open a finder window from command line type open .


Use MySQL 5.x universal, the 4.1 version on the mysql site contains some libraries for PPC and will not compile mysql-python, the python database driver for django. MySQL Downloads If you have MySQL 4x installed, backup the existing mysql databases. Run this before you install mysql5

mysqldump -u {user} -p{password} –all-databases > alldb.sql

Follow the instructions on the prebuilt binary to install, (its not that hard, just move the files and repoint some symlinks)

Once Mysql is in the correct spot, start it up. If you had Mysql 4 installed, reboot.

If you backed up the 4x databases, navigate to where your alldb.sql file is.

mysql -u {user} -p{password} < alldb.sql

Install mysql-python (MySQLdb-1.2.1) from sourceforge.com. This is a simple compile make cycle. It WILL NOT WORK with some univeral releases of MYSQL 4, I tried for hours.


install subversion universal.

Subversion

Subversion DMG


Install python 2.4, again, the database driver won’t compile with the stock osx python.

If you have done alot of 3rd party python modules installed, make some adjustments to your path, or look in your site-packages folder for that installation ( type python -v to see where the installation is ) see what you have and reinstall.

Python Universal


Time for command line fun. I am assuming you will want to use the development version of django, since its what the guys who wrote django recommend.

open up terminal Applications >> Utilities >> Terminal ( drag this to your dock it will save time )

This will put a directory called django in your home directory, whenever you want to update the version of django run ‘svn update’ from the commandline within this directory.

cd
su
svn co http://code.djangoproject.com/svn/django/trunk/ django_src
ln -s `pwd`/django_src/django /Library/Python/2.3/site-packages/django
ln -s `pwd`/django_src/django/bin/django-admin.py /usr/local/bin/django-admin.py
cd ~/Sites
django-admin.py startproject djangotest
cd djangotest
python manage.py runserver

You are up and running. :)

Comments

Leave a comment

Comments