AP257
AP257

Reputation: 93793

Django: how to upgrade from 1.1 to 1.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.

Upvotes: 2

Views: 3336

Answers (6)

garmoncheg
garmoncheg

Reputation: 906

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.

Upvotes: 0

MontyThreeCard
MontyThreeCard

Reputation: 831

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.

Upvotes: 0

Jordan Reiter
Jordan Reiter

Reputation: 21002

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.

Upvotes: 0

Manoj Govindan
Manoj Govindan

Reputation: 74705

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.

Upvotes: 2

dotty
dotty

Reputation: 41433

svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk
cd django-trunk
sudo python setup.py install

Upvotes: 0

juanefren
juanefren

Reputation: 2958

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.

Upvotes: 0

Related Questions