Weeknotes 2020 WK 42
Django
Python version compatibility
We confirmed compatibility with Python 3.9, for all supported versions this week. Mariusz has been slowly rolling it out across the test matrix and, bar small tweaks to the test suite, it already works.
Two points worth noting:
- Support for Python 3.9 is officially coming with Django versions 2.2.17, 3.0.11, and 3.1.3 which are due November 2nd.
- Django 3.2 will be the first version to support Python 3.10.
The policy is to drop support for Python versions after the LTS, so with Django 4.0 Python 3.7 will be the minimum support version.
We’re OK for now but, with Python’s new Annual Release Cycle (PEP 602) we might have to speed this up, as Django’s release cycle (LTS-to-LTS) is quite long. I didn’t plot it yet but it feels like we’ll need to add dropping of Python versions mid-cycle as they hit end-of-life.
F-strings
Django moves slowly, utterly inexorably, but slowly. This is 100% right. It’s why you like it. It’s why you can trust it.
To wit, this week we merged an adjustment to the coding style guide to allow f-string usage.
Feasibly, we could have done this for 3.0, having dropped Python 3.5 support after the 2.2 LTS but, there were some concerns about readability, and debate over whether f-strings would become the One Blessed Method.
Executive summary, they won’t: %-formatting is fine, and often better, and even format() has its place sometimes. Simple uses of f-strings are now allowed, and that’s good, but if you’re doing more complex things in your f-strings, we’re going to ask you to rephrase.
Corporate Member Badges
There’s also a new page on the Django website for badges for Corporate Members of the DSF. This allows you show your support, with various versions to match your colour scheme.
Again, if your company uses Django I strongly recommend you to take up a Corporate Membership. It’s tax-deductible and, it helps to ensure that the framework your business is built upon continues to thrive.
Podcasts
Django Chat
This week we released a Django Chat with David Fischer from Read The Docs/EthicalAds.io. It was a good discussion, on good topics. Do grab a listen if you didn’t yet.
Then we recorded an interview with Carl Meyer who was part of the old Django Core, former Technical Board member, and all the rest of it. Carl is one of those people who, when I’m working on tickets, I’ll find in the issue tracker having made some perfect observation X years ago on the topic in hand. As such, it was a real honour to talk with him.
Carl went on to work at Instagram, and gave a talk about Instagram’s use of Django and scaling it at Django Under the Hood in 2016. I was asking him about the same, since it’s fascinating.
They dropped the ORM early. This was pre-multi-database support. I can’t imagine that the ORM would go all the way to Instagram’s scale, but I wonder how the story would have evolved if that had been in place.
Django’s request-response handling is still in place. That’s the big validation. They’ve written custom backends for various components, auth, sessions, and so on, one presumes, which itself is a success story, since that was the purpose of the APIs there. That the core HTTP handling can grow all the way to Instagram’s scale, though, shows that the heart of the framework is sound. After 15 years, we know this, but still.
I touched on similar in my talk at DjangoCon last year: BaseHandler, that is the heart of the HTTP handling is less than a couple of hundred lines long — there’s no room for it to be clunky.
Python Bytes
Will and I also recorded an episode of Python Bytes with Micheal Kennedy and Brain Okken.
It was a good chat. We covered everything from deployment, to security in Django, recognizing contributors to open source, and doing geo-data visualisation with Pandas.
I think it’s out in a week or so.