Ponytech

Technology for ponies

Mar 05, 2013

Django 1.5 released

Django 1.5 had finally been released after two release candidates. Let's have a look in details of what it comes with.

It is the first Django version to support Python 3. This feature required a long work and is still considered experimental : do not use it in production. Django 1.6 is planned to be the release ready for Python 3 production. In the meantime, this 1.5 release let you start working on porting your app.

The other big features it adds is a configurable user model to exactly let your application tailor your needs in term of user's specific field or constraints. In previous versions you had to create a sperate table and link it to to the User model through user's profile to add information (facebook id, birthdate, etc) tied to your users. This feature is now deprecated in favor of the configurable user model. Also this new user model lets you specify different constraints. What if you want usernames to be 50 characters long ? This was simply not possible with prior django versions.

If you have models with a large number of fields and your are looking at some optimisations you may be interested by saving a subset of model’s fields. For example:

entry.title = 'New title'
entry.quthor = 'John Doe'

# only update author
entry.save(update_fields='author')

Other noteable additions concerns caching of related model instances, support for streaming responses, a new template tag to ease the use of Javascript in templates.

For an exhaustive list, consult the release notes