Weeknotes 2021-06-28
,Interesting Articles / Podcast Episodes
- Great article about subclassing in python
- How to do documentation
- Entertaining youtube channel about technology
Miscellaneous things. Mostly Weeknotes and links I stumbled upon.
With version 3.1, you can finally use asynchronous views, middlewares and tests in Django. Support for async database queries will follow later. You don’t have to change anything if you don’t want to use those new async features . All of your existing synchronous code will run without modification in Django 3.1.
Async support for Django is on it’s way for quite some time now. Since version 3.0 there’s support for ASGI included. But there was not much benefit for end users though. The only thing you could do concurrently were file uploads, since uploads don’t reach the view layer which was not async capable in Django 3.0.
When do you might want to use those new features? If you are building applications that have to deal with a high number of tasks simultaneously. Here are some examples:
As Tom Christie explained in his talk Sketching out a Django redesign held at DjangoCon 2019 the core question is this: Do we want to have to switch languages to support those use cases? And while his Starlette project (gaining popularity recently in combination with the FastAPI framework) is allowing us to do all this in Python, we also might want to keep using Django.
Estimated read time: 25 minutes
There's also a podcast episode elaborating a little bit more on this topic (it's in german).