Just Digital

Don't stop the dancing

Migrating your application from Django 1.2 to 1.6

Django 1.6 is out as of 6th November 2013 and I've managed to earn myself enough spare time to have a look.

If it ain't broke, don't fix it

Why upgrade? Here's my two big reasons:

  1. Security. There have been 25 security releases issued since I first built this site back in October 2011
  2. I'm probably going to have to start upgrading our applications sometime soon so I thought I'd bite the bullet early on with a smaller project

Doing things in a Pythonic way pays off :) If I may I'll urge you to seek out the conventions and best practices. just-digital.net (codenamed jdblog) implements about 5 model classes and 5 views. It also has several context processors (for tweets and forms) and a middleware class for breadcrumbs. I managed to migrate the entire application without rewriting a single bit of code (not including settings.py)

The biggest issue was obviously the new project layout. I figured it would be faster and cleaner to start a new project using $ django-admin.py startproject - then copy-paste the apps, and adjust the settings.py accordingly. Doing it that way only cost me 2 hours.

Deprecated discountenance (all since 1.2)

  • mod_python support
  • Function-based generic views (django.views.generic.create_update, django.views.generic.date_based, django.views.generic.list_detail, django.views.generic.simple)
  • Test client response template attribute
  • DjangoTestRunner
  • Changes to url and ssi
  • Changes to the login methods of the admin
  • reset and sqlreset management commands
  • GeoDjango
  • CZBirthNumberField.clean
  • CompatCookie
  • Loading of project-level translations
  • PermWrapper moved to django.contrib.auth.context_processors
  • Removal of XMLField
  • Old styles of calling cache_page decorator
  • Support for PostgreSQL versions older than 8.2
  • Request exceptions are now always logged
  • django.conf.urls.defaults
  • django.contrib.databrowse
  • django.core.management.setup_environ
  • django.core.management.execute_manager
  • is_safe and needs_autoescape attributes of template filters
  • Wildcard expansion of application names in INSTALLED_APPS
  • HttpRequest.raw_post_data renamed to HttpRequest.body
  • django.contrib.sitemaps bug fix with potential performance implications
  • Versions of Python-Markdown earlier than 2.1
  • django.contrib.localflavor
  • django.contrib.markup
  • Streaming behavior of HttpResponse
  • django.utils.simplejson
  • django.utils.encoding.StrAndUnicode
  • django.utils.itercompat.product
  • cleanup management command
  • daily_cleanup.py script
  • depth keyword argument in select_related

For more information about version see release notes at 1.3, 1.4, 1.5, 1.6

  • Hiya!

    I'm a friendly local developer in New Zealand turning coffee into code and talking about it all here.
    - Kevin

  • Contact me

    Need some freelance or contract work, hire me for small or medium jobs. Contact me here.

  • Tweets

    I'm really impressed at how quickly @Localcoinswap_ moves. They've just released the Whitepaper and it's a really… https://t.co/ZhHpCOElLg

    @Localcoinswap_ when can we read the whitepaper? https://t.co/9d4Gqsx3zW

    Anybody having a hard time buying crypto with fiat? It took me 2 day, and a handful of throw-away accounts only to… https://t.co/shqle1CkRQ

    "A Foolish Consistency is the Hobgoblin of Little Minds" #PEP8 should be taught in primary school. http://t.co/LZgPY4PA

    @shawn_hamman check out "Magnetospirillum magneticum". I want to keep some as pets. http://t.co/8xMa2Ntb

  • Categories