Weeknotes 2022-11-14
,Lots of stuff to do. Some of the projects I worked on last week:
Homepage
Since last week it's possible to deploy my homepage to staging using the new Wagtail-backed django-cast. I start to wonder how much effort it will be to migrate the content. In the old system, blog posts are just plain Django templates that are stored in the database and will be rendered upon request. This works fine but only if you fully trust the content editors, since they can inject arbitrary javascript code for example. But I want to use it to build a SaaS product and this would make it rather unpleasant I guess. In the new django-cast version I'll use the Wagtail CMS editor which should be safe to use for untrusted editors.
But now I need to convert all my template-based content to StreamField. Which seemed difficult at first, but then my lack of HTML knowledge saved the day: just throwing my old HTML content into a RichTextBlock living in a StreamField worked surprisingly well (see this: from legacy to wagtail conversion notebook). Seems like I can get away with just converting my custom template tags for images, galleries, videos and audio into proper StreamField blocks and keeping the rest of the html basically as it was. Sweet.
Django-Cast
Added a DELETE_WAGTAIL_IMAGES setting to be able to deactivate wagtail delete images physically to be able to test migrations.
This only works if cast happens to be placed behind wagtail in INSTALLED_APPS since Django has no way to call a function after all apps were installed. Video posters do now work with wagtail videos. The gallery modal now also works on the blog list page and not only on the post detail page.
django-template
Articles
- Substitute | webcomic
- A Python 3.11 “gotcha”
- The internet is already over
- Curiosity as tourism
- An interactive guide to color & contrast
- Mastodon is just blogs | Ok, I'll probably give mastodon a try, having to host it by myself probably, since masto.host is temporarily unavailable atm
- Inside the mind of a frontend developer: Hero section
Twitter
Weeknotes
- Weeklog for Week 44: October 31 to November 06 | Johannes
- Week in Review 2022-11-07 | Luis
- Designing a write API for Datasette | Simon Willison
Software
- In defense of linked lists
- minestrone | nicer wrapper around
Beautiful Soup
microblog.pub - A self-hosted, single-user, ActivityPub powered microblog
Awesome Htmx
django-unfold - Unfold is a new theme for Django Admin incorporating some most common practises for building full-fledged admin areas
Books
Videos
- DjangoCon 2022 | Data-Oriented Django | Talk by Adam Johnson via Luis
Podcasts
- Episode 131: Exploring the New Features of Python 3.11 (The Real Python Podcast)
- Python Perf: Specializing, Adaptive Interpreter (Talk Python To Me)
- Python 3.11 is here and it's fast (Talk Python To Me)
- DjangoCon US 2022 Recap (Django Chat)
- #307: Your Python just got faster (3.11 is out!) (Python Bytes)
- Episode 129: Using an Ellipsis in Python & Goals for CPython 3.12 (The Real Python Podcast)
- Higher level Python asyncio with AnyIO (Talk Python To Me)