Skip to content
Mar 27 / PK Shiu

Should I Upgrade to Django 1.3?

Should I upgrade my Django application to the current version? The very short answer is Yes.

The slightly longer answer is “Yes if your application is more than a static site used by more than 10 people”.

Starts with the general first. Upgrading an application that is already in production is always a hard decision. What are general pros and cons?

Cons

  1. Cost — time and money. Someone has to (be paid) to do the work.
  2. Break something — for a non trivial update, chances are you have to make some code changes. When you touch the code, you may break something. To make it worst, what if the original developers are gone?
  3. Dependencies — if your application uses other third party software, have they upgraded? If they are incompatible with the new version, it will break.

Pros

  1. New Features — The availability of a new feature on it’s own is not a good enough reason for upgrading. “The site works now, why change?” A developer may want to try out a new feature on a new release. But it has to have real benefit to the application to make this a Pro instead of a Con.
  2. Speed Improvemence — platform vendors often upgrade a platform to improve performance. This is often a legitimate reason for upgrading.
  3. Avoid obsolescence — This point applies especially to web frameworks. The web environment changes quickly. Platform provider may choose to end support for older versions quickly.
  4. Security — This point also applies especially to web frameworks. New attacks are being develop every day. Beyond small emergency security fixes, a framework may add new security feature that is useful.

Let’s focus on Django. Speaking from real world experience, we have upgraded production django sites from 1.1 to 1.2 to 1.3 each time a new release comes up. Our reasons for upgrading are driven primarily by new features that we can use. Our sites are all transactional in nature. The more sophisticated the site, the more of a reason to upgrade.

New Features We Like: Working backwards from the current 1.3 release:

Django 1.3 Features that we like

  • Logging — finally we don’t have to use our own logging module anymore
  • ClearableFileInput widget so that standard forms can easily delete previously uploaded file content without crazy hacked solutions
  • Support for lookups spanning relations in Django admin’s list_filter option — this makes list_filter actually useful. Often with a large object hierarchy it only make sense to use list_filter to limit/segment the data at the top levels of the hierarchy.
  • Class Based Views — This is a major new feature. I will post more on this later.
  • Unittest2 — The new unittest2 test support is now provided within Django 1.3 even if you are running an older release of python. Many features in unitest2 helps you write tests faster.

How to Convince Your Clients or Management to Upgrade?

“If it ain’t broke don’t fixed it” maybe the response that you are getting. The best approach for us is to roll the upgrade work in with the next release. Initial conversion should not take more than one or two days. If you have a one week or a two weeks software release coming up, add the conversion work to it. That is what we do. And in the mean time, try upgrading on smaller non production sites.

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Google Bookmarks
  • Add to favorites
  • email
  • FriendFeed
  • Google Buzz
  • LinkedIn
  • Tumblr
  • Reddit

2 Comments

Leave a comment
  1. Marcin Nowak / Mar 31 2011

    The best feature of Django 1.3 is handling of transaction management context managers. Now we can control database transaction blocks in any place using `with` statement. This missing functionality was very annoying in older versions of Django.

Trackbacks and Pingbacks

  1. Quora
Leave a comment