BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Django 1.7 Is the Biggest Django Release since 1.0

Django 1.7 Is the Biggest Django Release since 1.0

Bookmarks

It took the Django Software Foundation nearly one year, but finally Django 1.7 is here. This is the biggest Django release since Django 1.0, featuring "a new app loading framework, a new check framework, many improvements to query construction, and most importantly - Migrations", a new built-in database migration system.

The full list of Django 1.7 new features and functionality is covered in the official release notes. However, some of the major highlights of Django 1.7 are described here.

  • New concept of Django applications

    Django 1.7 marks a shift away from the traditional view of an app as an entity tightly linked to a model and managed through a singleton known as the “app cache”.

    A new “app registry” is available in Django 1.7 "where models modules no longer have a central role and where it is possible to attach configuration data to applications."

    Among the benefits that this change brings are the possibility for apps to run code at startup, before Django does anything else; the possibility of omitting altogether models.py if an application doesn’t have any models, and others.

  • Database migration system

    Django now has built-in support for schema migrations, which are aimed at propagating changes made to an app's model (adding a field, deleting a model, etc.) into the database schema.

    Schema migration allows models to be updated, changed, and deleted by creating migration files that describe the changes to the model. Migration files can be run on any development, staging or production database.

    Migrations are designed to be mostly automatic, but developers will still need to know when to make migrations, when to run them, and the common problems that might arise.

  • An extensible system check framework

    The new System check framework allows to detect common problems, such as invalid models, and to provide hints for resolving them. The framework is extensible and additional checks can be added for new apps and libraries.

  • New method on Field subclasses

    To help power schema migrations as well as to enable easier addition of composite keys in future releases of Django, the Field API has a new required method: deconstruct(). The new method returns a tuple of four values that allow any field to be serialised into a file, as well as allowing the field to be copied safely, both tasks essential parts of Django new features.

Django 1.7 also includes backward incompatible changes, while other features have been removed at the end of their deprecation period.

Django 1.7 requires Python 2.7 or above, preferably the latest minor release. Support for Python 2.6 has been dropped and support for Python 3.4 has been added.

Django is a free and open source web application framework written in Python, which follows the model–view–controller architectural pattern. Django's primary goal is to ease the creation of complex, database-driven websites. Some well known sites that use Django include Pinterest, Instagram, Mozilla, The Washington Times, Disqus, and the Public Broadcasting Service.

Rate this Article

Adoption
Style

BT