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:
- located my main
djangodirectory (had to search for it – it was inside an egg insite-packages), and renamed todjango.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 - 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 - ran
svn co http://code.djangoproject.com/svn/django/trunk/ django_srcand
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) - Chose a good place on my
$PATHto symlink todjango-admin.py, and ransudo 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