The general picture of the chunks of software involved is:
At first glance, my machine has Python and MySQL already installed:
~:which python /usr/bin/python ~:which mysql /usr/local/mysql/bin/mysql
First, I downloaded and unpacked
However, reading the
README file, it looks like there are some version
- MySQL >= 3.23.32: A quick run of
mysqlshows my version as 4.1.15, so that's OK.
- Python >= 2.3.3: running
/usr/bin/python -Vjust shows "
Python 2.3". Thanks to this page, I could run
import platform;print platform.python_version()in the Python interpreter and discovered that the built-in version of Python is 2.3.0. Drat.
PUSH: Python 2.5
Quick digression to visit the
Mac Python page
and download a copy of Python 2.5. A normal Mac install procedure means that I've now
/usr/local/bin/python that reports 2.5.0, and it appears to be installed
POP: Back to MySQLdb
MySQL-python-1.2.1_p2 directory, I did a quick
chmod +x setup.py and then ran
setup.py build. This built very quickly, producing some stuff in the
sudo setup.py install
put things into the
Time for a quick test to check that everything is OK, using a Bugzilla database I've got running locally:
~:python Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import _mysql >>> db=_mysql.connect(host="localhost", user="bugs", passwd="password", db="bugs") >>> db.query("""select short_desc from bugs where bug_id < 10""") >>> r=db.store_result() >>> r.fetch_row() (('tracker.exe fails to run',),) >>> r.fetch_row(10) (('Using Word as email editor confuses tracker',), ('Mysteriously, many items have people = "none" should just be blank',), ('keyword combo should have whole description in it, not "same description"',), ('Dodgy start/end times just get mysteriously dropped',), ('Detect and drop the addition of duplicate keywords',), ("Get rid of menus that we don't use",), ('Add wildcards to project keywords',), ('Add help to activity forms',)) >>>
[Edit 2008-07-20: When I repeated this process later (on 10.5), I also needed to follow these instructions.]
I decided to take the Django folks at their word when
they claim that the development version is pretty stable, so I checked out the code with
svn co http://code.djangoproject.com/svn/django/trunk/ as suggested. (I downloaded in
November 2006, at which point the highest stable release was 0.95).
To make Django visible within Python just needed a
sudo ln -s `pwd`/trunk/django/
(To check it was visible, a quick
import django in Python didn't generate any errors.)
From here on, the normal Django documentation can take over.