2

Does anyone know how to / can anyone link to simple instructions for how to upgrade from Django 1.1 to Django 1.2?

I can find masses of documentation on the differences between them, the changes you'll need to make to your project etc.

What I can't find is actually how to upgrade!

Thanks.

AP257
  • 89,519
  • 86
  • 202
  • 261

6 Answers6

2

I usually create a symlink from my Python site-packages directory to the Django version I am using. When I change versions I merely change the symlink to point at the right version. Here is the documentation for creating a symlink. The docs mention the development version but you can do it for any version.

Manoj Govindan
  • 72,339
  • 21
  • 134
  • 141
0

Django 1.2 is fully compatible with 1.1, so your projects could stay the same way.

To update django in your server: If you already have a svn repository, just update it, Otherwise uninstall Django and then download it again from here http://www.djangoproject.com/download/ I have never had problems with trunk version, but that is your decision.

juanefren
  • 2,818
  • 6
  • 32
  • 41
  • 3
    That's patently false. Django 1.2 included several well-documented backwards-incompatible changes (notably the changes to CSRF protection). The backwards incompatible changes may not hit every used, but upgrading for most people will require at least a few code tweaks. – Gabriel Hurley Aug 10 '10 at 19:19
0
svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk
cd django-trunk
sudo python setup.py install
dotty
  • 40,405
  • 66
  • 150
  • 195
  • 1
    That doesn't upgrade you to 1.2, that upgrades you to trunk. – Dominic Rodger Aug 10 '10 at 16:01
  • Thanks - but how do I point an existing project at this version of Django, rather than the one it's using at the moment? – AP257 Aug 10 '10 at 16:09
  • @AP257: I usually create a symlink from my Python site-packages directory to the Django version I am using. When I change versions I merely change the symlink to point at the right version. – Manoj Govindan Aug 10 '10 at 16:57
0

First, follow the instructions for removing old versions of Django

Then, you can follow these steps to pull the released branch of 1.2.x:

svn co http://code.djangoproject.com/svn/django/branches/releases/1.2.X/ django
cd django
sudo python setup.py install

I agree with uanefren, though. Using trunk has never posed any issues for me, and it probably has the best ongoing support and most current documentation.

Jordan Reiter
  • 20,467
  • 11
  • 95
  • 161
0

Here's a good link using pip: how do you install django older version using easy_install?, which essentially comes down to:

pip install --upgrade django==1.2.5 (Which is the latest version of 1.2, AFAIK)

Also, before upgrading, make sure you read:

https://docs.djangoproject.com/en/1.2/releases/1.2/

and

https://docs.djangoproject.com/en/1.2/ref/contrib/csrf/#ref-csrf-upgrading-notes

As 1.2 implemented breaking changes for CSRF tokens. Also, make sure your save and delete methods include **kwargs, as the multiple database change adds a kwarg to the save (and possibly the delete) method(s). If you run Activestate, you can use pypm install django==1.2.5 instead.

Community
  • 1
  • 1
MontyThreeCard
  • 821
  • 9
  • 14
0

Imho most common problem of upgrade like this is CSRF protection changes you will meet in you Upgrading way. Main thing here is to read https://docs.djangoproject.com/en/1.3/releases/ of your django version. 1.2 is in your case.

This update has some backwards incompatible changes with CSRF protection described almost fist in 1.2 release changes.

There also some articles like http://garmoncheg.blogspot.com/2011/07/django-upgrading-django-from-11-to-125.html on blogs. Here is a brief look at this problem.

Hope this will help someone with those issues.

garmoncheg
  • 867
  • 11
  • 26