Home

Hello. My name is Noemi Millman, and Triopter is my web development agency. We handcraft beautiful, dynamic websites.

See what I can do for you.

Noemi Millman: Triopter: Upgrading Django from Stable to Subversion

Upgrading Django from Stable to Subversion

Django is in fairly heavy development, heading for a 1.0 release, and not only does there seem to be a lot of new functionality in the newest versions, but some of the older functionality is expected to break.

Since word on the mailing list is that development versions are not only quite stable, but actually recommended over the stable version, and since I don’t have any deployed apps to worry about breaking, I thought it would be better to upgrade now than later.

Even better, this will make future upgrades as simple as a single subversion command (and, well, some fixes for incompatibilities, but that would be the case anyway, and probably worse if I weren’t to keep up).

I was a bit scared about the upgrade, but it turned out to be much much simpler than I anticipated.  I found a thread on the mailing list about doing just such an upgrade.  It wasn’t very explicit, but when I extrapolated from it, it worked.
Here’s what I did:

  1. located my main django directory (had to search for it – it was inside an egg in site-packages), and renamed to django.bak (instead of deleting… in case of emergency).

    If you installed using DarwinPorts, like I did, the location is probably something like:

    /opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django

  2. created a directory for the new installation (anywhere your user has read, write, and execute permissions will do, it seems), and cd-ed into that directory
  3. ran

    svn co http://code.djangoproject.com/svn/django/trunk/ django_src

    and

    ln -s `pwd`/django_src/django /PATH/TO/SITE-PACKAGES/django

    (substituting the correct path, of course — in my case, /opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages)

  4. Chose a good place on my $PATH to symlink to django-admin.py, and ran

    sudo ln -s ./django_src/django/bin/django-admin.py /DIR/ON/PATH/

    (I dropped it in /opt/local/sbin, since DarwinPorts had added that to my path, and I preferred adding something there to putting it on a main system path.)

And… everything’s up and running, at least in terms of the development server (I hadn’t set it up to run on Apache in the first place — I don’t know if that would complicate things).

Simple, huh?

Post a Comment

Your email is never published nor shared. Required fields are marked *

Comments may be held for moderation to prevent spam: your comment may not appear immediately.