Yesterday, Django released its latest major update - Django 3.0. Django is a Python-based web framework designed to help developers build apps faster with less code. Django 3.0 now comes with built-in async functionality, Python 3.6, 3.7 and 3.8 support and third-party library support for the older version of Django.
Django now officially supports MariaDB 10.1 and higher. To use MariaDB you should use the MySQL backend, which is shared between the two.
Django 3.0 provides support for running as an ASGI application, making Django fully async-capable (Django already has existing WSGI support). However, async features will only be available to applications that run under ASGI. As a side-effect of this change, Django is now aware of asynchronous event loops and will block you calling code marked as “async unsafe” - such as ORM operations - from an asynchronous context.
This was one of the most eagerly awaited features.
https://twitter.com/jmcampbell72/status/1201502666431619072
https://twitter.com/arocks/status/1201711143103807490
https://twitter.com/gtcarvalh0/status/1201475826564382720
Django 3.0 adds a new ExclusionConstraint class which adds exclusion constraints on PostgreSQL. Constraints are added to models using the Meta.constraints option.
Expressions that output BooleanField may now be used directly in QuerySet filters, without having to first annotate and then filter against the annotation.
Custom enumeration types TextChoices, IntegerChoices, and Choices are now available as a way to define Field.choices. TextChoices and IntegerChoices types are provided for text and integer fields.
Django 3.0 has also dropped support for PostgreSQL 9.4 which ends in December 2019. It also removes private Python 2 compatibility APIs. The upstream support for Oracle 12.1 also ends in July 2021. Django 2.2 will be supported until April 2022. Django 3.0 officially supports Oracle 12.2 and 18c.
The complete list of updates is available in the release notes.
Django 3.0 is going async!
Which Python framework is best for building RESTful APIs? Django or Flask?
Django 2.2 is now out with classes for custom database constraints