-
Useful Django unit test patternsUseful Django unit test patterns
This is a collection of some common unit test patterns I find myself re-implementing across various projects. To save myself (and maybe some others) time in the future, I've decided to collect them all in one place.
20 March 2026 -
Writing Wagtail StreamField content migrationsWriting Wagtail StreamField content migrations
When you drastically change one of your StreamFields and generate a migration for your new structure, the migration won't actually update what's already in your database. It'll describe the new, intended structure behind the fields, but the JSON data itself will remain exactly as it is.
18 February 2026 -
Directly filtering Wagtail parent/child pagesDirectly filtering Wagtail parent/child pages
In Wagtail, pages don't have a typical, direct relationship like you'd expect in Django. Instead of using foreign keys to link them, each page has a `path` and a `depth` attribute...
24 November 2025 -
Django and Wagtail test factoriesDjango and Wagtail test factories
A factory is a system that lets you easily mock data for your tests and creates as many records as you need for your test cases.
5 November 2025 -
Django: Locking database records before updatesDjango: Locking database records before updates
To 'lock the record' means to tell the database that this particular piece of data is currently in use and shouldn't be given to anyone else who requests it.
15 October 2025 -
HTMX and Wagtail CMS quickstartHTMX and Wagtail CMS quickstart
The first step to using HTMX with any project is loading it into the environment. That can be achieved by following the installation instructions on their website.
28 August 2025 -
Wagtail no scheduled publishing optionWagtail no scheduled publishing option
Wagtail supports scheduling a page’s publication date and time out of the box. The first time I tried to use this feature, I lost a lot of time to an issue where the expected ‘Set schedule’ button wasn’t displaying in the page’s ‘Status’ tab.
3 July 2025 -
Using wagtail-seo hours of operation in templatesUsing wagtail-seo hours of operation in templates
wagtail-seo comes with various SEO settings for your site, including fields for ‘Hours of operation’. I needed to take this data and output it on a template in a nice format. This approach is minimal and effective, so if you are also looking to build a global opening hours widget, …
16 May 2025 -
Changing Wagtail ChoiceBlocks without migrationsChanging Wagtail ChoiceBlocks without migrations
I’ve recently been building some content systems within Wagtail that utilise the ChoiceBlock and MultipleChoiceBlock. The project required these to be modifiable without generating migrations for a few reasons, so I’d like to share my solution for facilitating this.
14 May 2025 -
Dockerise Python with a background CRON runnerDockerise Python with a background CRON runner
Since January, I’ve worked full-time in Django and Wagtail development. In my last post, I shared my Dockerfile for deploying such projects. That Dockerfile includes a multi-stage build to reduce the final image size and to improve security. This directly builds on that Dockerfile.
22 April 2025 -
Writing a Minimal Wagtail, Poetry & Node DockerfileWriting a Minimal Wagtail, Poetry & Node Dockerfile
Over the last few months, I have worked extensively on several Wagtail projects. Off the back of this, I have decided to pivot from focusing on WordPress development in favour of Django and Wagtail.
8 April 2025 -
How to run Pygame in the browserHow to run Pygame in the browser
I’ve built several projects using Pygame, such as a solar system simulation and a Zelda-like dungeon crawler. My biggest frustration has always been the complexity of sharing the projects with others.
10 March 2025