Welcoming Django 4
Written by Alex Denham   
Friday, 10 December 2021

Django, the high-level Python Web framework for creating full stack dynamic websites, has had a major update.  Django 4.0 adds support for functional unique constraints, has a new more secure password hasher, and uses more Python standard libraries.

We've looked at several of these features when we reported on the Beta version of Django 4, however there are other features that are noteworthy.

django

Improvements to Django 4 start with the addition of a Rediscache backend that adds built-in support for using Redis as the back end for your Django apps. Another improvement is easier customization of Forms, Formsets, and ErrorList as they are now rendered using the template engine. Timezone handling has also been improved, and the Python standard library’s zoneinfo is now the default timezone implementation in Django.

The Django framework makes website development easier by taking care of user authentication, content administration, site maps and RSS feeds so security is a key issue. Security improvements include a new password hasher, scrypt, that is more secure and recommended over PBKDF2. Scrypt uses a set number of iterations to slow down brute-force attacks like PBKDF2, but is designed to use more memory to limit the amount of parallelism an attacker can use. This reduces the option for attackers with sufficient resources to launch large-scale parallel attacks to speed up the attacking process.

Unique constraints for ensuring unique values in a database column, and for preventing duplicate values from appearing in the column, can now be better controlled from Django. A new expressions positional argument for UniqueConstraint() has been added. This lets you create functional unique constraints on expressions and database functions.

In Postgresql, developers can create a functional unique index with 'Lower' and it will work as a case insensitive unique constraint. The new support makes it possible to pass this from Django.

Django 4.0 supports Python 3.8, 3.9, and 3.10. The Django 3.2.x series is the last to support Python 3.6 and 3.7. Django 4 can be downloaded from the Django project's download page.

 

django

More Information

Django Project Website

Related Articles

Django 4 Beta 1 Released

Django 3 Adds Support For ASGI

Django 1.3 released

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Java Version 22 Released
04/04/2024

JDK 22 is not a Long Term Support release, but is one of the regular releases that are scheduled to arrive every six months. Still, it has got a lot to show for itself.



Avi Wigderson Gains Turing Award
16/04/2024

Israeli mathematician and computer scientist, Avi Wigderson, is the recipient of the 2023 ACM A.M Turing Award which carries a $1 million prize with financial support from Google.


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Saturday, 11 December 2021 )