From f299250ec14910735726e27b897fa557164eda41 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 27 Apr 2019 23:18:26 +0100 Subject: [PATCH] Cleanup markdown --- content/posts/django-22.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/content/posts/django-22.md b/content/posts/django-22.md index 0515c9a..ba70433 100644 --- a/content/posts/django-22.md +++ b/content/posts/django-22.md @@ -12,7 +12,6 @@ Django historically works off the LTS pattern of software releasing, providing 2 The bump between 1.11 and 2.2 also bought with it the updates from 2.0 and 2.1. Those features which have been being used by users for 18 months finally come to those who need the stability of an LTS release. I've not delved too far into the 2.x releases so far, as most of what I do strongly benefits from using an LTS-based version. - ## Python 2 Ironically named, Django 2 is the first Django release to completely drop support for Python 2. Django 2.2 will require at least 3.5. Python 2 (commonly referred to as 'legacy python') will retire [in 2020](https://pythonclock.org/), so it's great to see Django dropping support well beforehand so users can start migrating their larger codebases. For years there's been a debate as to which major version of python is better: 2 or 3. Considering Python 2 now has an end-of-life date, and the performance gap is now a non-issue, hopefully this debate is over. @@ -23,7 +22,6 @@ In previous versions, Django's URL system relied heavily on regular expressions Thankfully, Django 2.0 fixed this, by drastically simplifying the URL routing syntax to allow for special keywords to be in place of RegEx capture groups. The new syntax is available with the new `path` function: - ```python path('articles//', views.year_archive), ``` @@ -44,7 +42,6 @@ This is a significant improvement over the previous methods. The intention is to ## Django Admin - ### Mobile-friendly The django admin is now mobile friendly. This isn't a massive deal considering likely how few people are using it in production, but considering it's a fairly useful administration panel for smaller, say self-hosted projects, it's nice to see it getting some much needed UI love. @@ -157,7 +154,6 @@ Django now has some built-in support for protecting against these kinds of attac This can then be used by JavaScript directly by getting the tag by ID. If you still need to inject data directly into JavaScript source, `django-argonauts` still provides additional functionality. - ## Constraints The new constraints API in Django 2.2 allows for far greater control of database-level validation on model fields than previously available in field validators. These validators are applied at the model level, rather than the field level. Django 2.2 comes with 2 existing constraints: `UniqueConstraint` and `CheckConstraint`. Both constraints are executed at the database level (as additional queries rather than column-level constraints), which whilst making them faster when doing complex relationship-level validation, also increases the number of queries executed when modifying a model instance.