Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon

Django 3.0 released with built-in async functionality and support for MariaDB and Python 3.6, 3.7 and 3.8

Save for later
  • 2 min read
  • 03 Dec 2019

article-image

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.

New features in Django 3.0

MariaDB support


Django now officially supports MariaDB 10.1 and higher. To use MariaDB you should use the MySQL backend, which is shared between the two.

ASGI support for async programming


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

Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at $19.99/month. Cancel anytime

Exclusion constraints on PostgreSQL


Django 3.0 adds a new ExclusionConstraint class which adds exclusion constraints on PostgreSQL. Constraints are added to models using the Meta.constraints option.

Filter expressions


Expressions that output BooleanField may now be used directly in QuerySet filters, without having to first annotate and then filter against the annotation.

Enumerations for model field choices


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