Hi, I'm Matthias

I am a founding partner of Feinheit AG and Die Bruchpiloten AG. Find me on GitHub, Mastodon, LinkedIn or by email.

2023-07-28

Weeknotes

Async Django

I have used Django Channels successfully in a few projects from 2017 to 2019. A few months back I have worked with Starlette. And now I have finally started digging into using Django itself with an ASGI server, and not just for one or two views but also including the middleware stack etc since I also need authentication, not just an endpoint forwarding requests to a remote server. I have looked at Granian, an RSGI/ASGI server written in Rust. But for now I am using uvicorn.

Django truly has come a long way but there’s much left to do. Django 5.0 is looking great already, but 4.2 misses many pieces still. I am really really glad Django wants to stay backwards compatible but I wish I could wave a magic wand and upgrade everything to async. Adding a prefixes everywhere for the async version is certainly a good compromise and probably the way to go but it’s just not that nice.

I have been playing around with making feincms3’s applications middleware async compatible because I want the full middleware stack to be async. The code is already released but undocumented and not even mentioned in the changelog. So, feel free to play around with it but it’s not supposed to be stable or supported yet.

Releases

  • feincms3 4.1: Switched to hatchling and ruff. Updated the feincms3-sites docs. Some async updates mentioned above. A Django 4.2 admin CSS update for the inline CKEditor.
  • feincms3-forms 0.4: Switched to hatchling and ruff. Started defining default icons for the form fields content editor plugins.
  • django-ckeditor 6.7: I’m still maintaining the CKEditor 4 integration for Django even though CKEditor 4 itself isn’t supported anymore. Minor updates to the editor itself and Pillow compatibility updates.
  • feincms3-cookiecontrol 1.3.2: The cookie banner doesn’t generate an empty <div class="f3cc"> element anymore if there’s nothing to add inside (e.g. if the user only accepted necessary cookies).