Django 2.2 LTS
What's new?

Kalil de Lima - Python Meetup 2019

github.com/kaozdl

kalil.de.lima@fing.edu.uy

kalil@rootstrap.com

From where do we come?

April 2017 - Django 1.11

Last version to support Python 2

What is Django?

Full fledged web framework for python

First version is from 2005

Implements the MVT pattern

Key Features

Powerful ORM

Wide library ecosystem

Great defaults

Easily customizable

Recent History

In April of 2017 Django shipped version 1.11 - LTS

This was the last version of django which included support for python 2.7

After that the community started to work in a new major release of the framework.

What happened since then?

  • Django 2.0

  • Django 2.1

  • Django 2.2

One major release, and two minor ones

Django 2.0

path function in django.urls

Responsive admin

Star features

Quality of Life Improvements

values_list can now return named tuple

earliest, latest now accept multiple args

squashmigrations now allows to name the squashed migration

inspectdb now instrospects JSONFields in postgres

Old URL paths

New Url paths

Django 2.1

view permission allows read only access to models

Star features

Quality of Life Improvements

createsuperuser now allows bypassing password validations

BooleanField now accepts null=True NullBooleanField discouraged

The new Queryset.explain() method shows db execution plan

Queryset.explain

Django 2.2

Constraints

Star features

Quality of Life Improvements

ignore_conflicts argument for Queryset.bulk_create

New Queryset.bulk_update method

Smarter single query transaction policy

request.headers attribute

Constraints

Performed at database level

Require a migration

Method independent

Work nicely in batches

Constraints in Model.meta

Batch operations

bulk_create

Multiple objects created per query

 

ignore_conflicts parameter

 

Does not handle many-to-many cases

 

Objects need to be

handled in memory

bulk_update

Updates several objects

in a single query

 

Extra queries for multi-table inheritance

 

Objects need to be

handled in memory

Constant time upsert

Thanks for listening!!

Django 2.2 LTSWhat's new

By Kalil De Lima

Django 2.2 LTSWhat's new

  • 279