Live data from Hacker News

Django 1.4.9 and 1.5.5 released

djangoproject.com

11–20 of 24 posts

Re: Django 1.4.9 and 1.5.5 released

#11

Just curious, how badly would an upgrade from 1.2 go? I want to do it if it takes less than a day.

1.4 to 1.5 is the biggest change.

I think the way to upgrade is to do it piecewise, one release at a time.

Here's what we do:

1) upgrade 3rd party packages to latest. I wrote a little script to apply each new package one-by-one, rerun tests, and revert any that fail. Resolve any failures.

2) turn deprecations into errors, run tests again, and resolve any deprecation notices.

3) Read release notes from 1.2 to 1.3 so you have a sense of what's changing.

4) upgrade django from 1.2 to 1.3, then rerun tests.

5) Repeat steps 2-4 with each django release (1.3->1.4, 1.4->1.5).

This way, if / when things break during the upgrade process, you have some isolation as to what changed.

I'm not sure you can get all the way from 1.2 to 1.5 in a day, but if you spend half a day you can get a sense of how far you get, and what issues you have to resolve to finish.

You definitely want to get to at least 1.4, since that's the oldest version that has security patches.

If you don't have good tests? Start by writing tests until you have decent coverage. The django testing page has good info on coverage tool integration.

Re: Django 1.4.9 and 1.5.5 released

#12
post #9

Just curious, how badly would an upgrade from 1.2 go? I want to do it if it takes less than a day.

Do you have good tests? I've done this pretty recently and it got somewhat messy -- though I had great test coverage on the project that I upgraded, so it probably only took a day or so. The main road bump I hit was Django Piston. It's totally broken past 1.5 and there are a gazillion forks that solved non-overlapping subsets of the problems I was having.

Makes me pat myself on the back for trying to resist non-essential packages if I can roll my own, as much as possible :)

Re: Django 1.4.9 and 1.5.5 released

#13
post #7

Just curious, how badly would an upgrade from 1.2 go? I want to do it if it takes less than a day.

I've never actually done a 1.2.x to 1.5.x upgrade in one go, but have done plenty of 1.3 to 1.5s. As far as I recall, for Django itself, the 1.2 to 1.3, and 1.3 to 1.4 upgrades were pretty painless, but then 1.4 to 1.5 will involve some work if you make use of function based generic views, as that's when they were removed. Worth looking at whether your third party apps are still maintained with the new versions as we…

I actually found the 1.3 to 1.4 upgrade to be much more work than 1.4 to 1.5. But that was because I'd been using the old style directory layout, so the whole project structure had to change. And I never used function based generic views very heavily, so that didn't factor in very much.

Re: Django 1.4.9 and 1.5.5 released

#15

Which version should one use? I went digging thru the FAQs, but the 1.5 series is still listed as experimental. It's not immediately clear which is stable and which is developmental.

1.5 is current. If it's listed as experimental somewhere, that is out of date.

Re: Django 1.4.9 and 1.5.5 released

#16
post #13
post #7

Earlier quoted context omitted.

I've never actually done a 1.2.x to 1.5.x upgrade in one go, but have done plenty of 1.3 to 1.5s. As far as I recall, for Django itself, the 1.2 to 1.3, and 1.3 to 1.4 upgrades were pretty painless, but then 1.4 to 1.5 will involve some work if you make use of function based generic views, as that's when they were removed. Worth looking at whether your third party apps are still maintained with the new versions as we…

I actually found the 1.3 to 1.4 upgrade to be much more work than 1.4 to 1.5. But that was because I'd been using the old style directory layout, so the whole project structure had to change. And I never used function based generic views very heavily, so that didn't factor in very much.

I'm still using the directory layout from 0.96 with Django 1.6. What forced you to change?

Re: Django 1.4.9 and 1.5.5 released

#17
post #10

Just curious, how badly would an upgrade from 1.2 go? I want to do it if it takes less than a day.

I'm curious as well. Did anyone have problems with the new timezone thing that came with 1.4?

Beware of using DateTimeField for anything which uses DateMixin - https://docs.djangoproject.com/en/1.5/ref/class-based-views/...

You can end up in a weird situation with 404s due to timezone settings. Our timezone is set to Europe/London, the get_absolute_url method for any objects between midnight and 1am BST returns the result for the wrong day. The object will still be visible, just not at the expected URL.

If you're using dates for URLs, add an additional DateField, set it to editable=False, add something in save() which sets the date based on the datetime, and use the date field for your get_absolute_url method.

Re: Django 1.4.9 and 1.5.5 released

#18
post #13
post #7

Earlier quoted context omitted.

I've never actually done a 1.2.x to 1.5.x upgrade in one go, but have done plenty of 1.3 to 1.5s. As far as I recall, for Django itself, the 1.2 to 1.3, and 1.3 to 1.4 upgrades were pretty painless, but then 1.4 to 1.5 will involve some work if you make use of function based generic views, as that's when they were removed. Worth looking at whether your third party apps are still maintained with the new versions as we…

I actually found the 1.3 to 1.4 upgrade to be much more work than 1.4 to 1.5. But that was because I'd been using the old style directory layout, so the whole project structure had to change. And I never used function based generic views very heavily, so that didn't factor in very much.

Interesting. I found the 1.3 to 1.4 upgrade only took a few hours. The 1.4 to 1.5 was a bigger deal because of the new syntax for the {% url %} template tag. Especially since this had to be dealt with in third-party packages.

Re: Django 1.4.9 and 1.5.5 released

#19

Which version should one use? I went digging thru the FAQs, but the 1.5 series is still listed as experimental. It's not immediately clear which is stable and which is developmental.

Where did you see 1.5 listed as experimental?

The front page clearly has 1.5.5 as the release and that takes you to a page that has 1.5.5 listed as the latest official version and 1.6 as the development version.

Are you referring to 1.5's Python 3 support? That is experimental, but 1.5.5 itself is not.

Re: Django 1.4.9 and 1.5.5 released

#20
post #9

Just curious, how badly would an upgrade from 1.2 go? I want to do it if it takes less than a day.

Do you have good tests? I've done this pretty recently and it got somewhat messy -- though I had great test coverage on the project that I upgraded, so it probably only took a day or so. The main road bump I hit was Django Piston. It's totally broken past 1.5 and there are a gazillion forks that solved non-overlapping subsets of the problems I was having.

Yes, Piston is an absolute PITA.

However, Class-Based Views nowadays solve the same problem domain much better, and I would think that it's easier to write a CBV that's support some of Piston's idioms and refactor a bit than try to take Piston the latest Django version.

Post reply on HN