In association with heise online

26 March 2012, 11:01

Django 1.4 arrives with time zone support

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

Django logo

Django 1.4, the Python web framework, has been released exactly one year after the release of the previous major version. One of the most notable enhancements in version 1.4 of the framework is support for time zones when handling dates and times; the framework's new time-zone-aware objects store date and time as UTC internally and translate them to user's local time zone when displayed. The new feature does come with a warning that some "sloppy behaviour" that used to be allowed is no longer allowed, and the developers suggest consulting a special time zone migration guide and faq for guidance.

Improvements in the framework's ORM (Object Relational Manager) include the addition of the ability to generate SELECT ... FOR UPDATE SQL queries and a bulk_create() command for insertion of large datasets. Django 1.4 can now handle IPv6 addresses better with the introduction of a GenericIPAddressField model and form field and validators. In-browser testing frameworks like Selenium are now supported with a "LiveServerTestCase" base class allowing tests of interactions between frontends and backends of applications. The developers have also updated the default project layout and added support for templates when creating new apps and projects for simpler custom project layouts.

To improve security, password hashing now uses PBKDF2 by default, rather than Django 1.3's SHA1 hashing, and the system now allows the hashing algorithm to be easily changed to, for example, the newly supported bcrypt2 algorithm. A cookie-based session backend which uses cryptographic signing on the session data should improve the security of user sessions; it is also used to save state in the new FormWizard. There are also improvements to CSRF features including protection for PUT and DELETE requests.

An extensive list of these and other improvements in included in the announcement. A number of features are being deprecated in 1.4 and the new release includes a number of backwards incompatible changes; care is advised when migrating to the new version. Django 1.4 supports Python 2.5, 2.6 and 2.7; Python 2.4 support has been dropped and is only supported by Django 1.3, which is still receiving security updates. Python 3.x is also not supported but the developers are working on plans to support the leading version of Python in future versions.

Django 1.4 is available for download from the Django site and is distributed under the 3-clause BSD licence.

(djwm)

Print Version | Send by email | Permalink: http://h-online.com/-1479707
 


  • July's Community Calendar





The H Open

The H Security

The H Developer

The H Internet Toolkit