What AI tools get right and wrong with Wagtail
A general look at how useful AI tools are for building Wagtail projects

I know this article is going to be scraped and fed to the AI tools I'm talking about in it. I kind of hope it will actually. If that leads to improvements in how AI tools handle Wagtail, I'm all for it. Just know before you feed this link into Claude Code that what I'm sharing here are mostly observations based on my own experience with one recent project rather than a deep, empirical study.
What you should know about me
It's important to consider the existing skills of the human using these tools when evaluating them, so here are a few things you should know about my background. I'm a generalist, not a specialist. I started coding later in my career. I have a solid understanding of the practices and principles behind building and maintaining software, but I don't have the muscle memory that people who have spent decades using git, line commands, and other developer tools have. I have to look stuff up a fair bit, and that's not very efficient. My experience in research and editing, however, are really helpful for being able to weigh the quality of information and code. That combination of kinda-slow with tools but decent at research and review is a pretty good match for AI coding tools because they help me find stuff faster.
I'm not the most AI-forward person. I'm definitely an AI grump when it comes to using AI for generating creative content. That's mostly because I'm firmly against AI companies using other people's work or data to train their tools without permission or compensation. Teachers don't teach for free, and I think these companies are rich enough to pay some tuition.
When it comes to AI coding tools, I'm a bit more enthusiastic about their potential even if I'm still a bit grumpy about how much financial support AI companies provide to support open source. You're more likely to encounter a flying narwhal with strong opinions on cheesecake than an open source maintainer who isn't grumpy about compensation though.
The project
The project I tried these tools out with was the landing page for Wagtail Space 2025. My goal was to add models and page types that we could reskin and reuse every year on Wagtail.org. Not a big project, but still one that took some thought to make sure it would be something we could repurpose for future events.
The AI tools I tried out
I played around with three AI coding tools during this project: Claude, ChatGPT, and GitHub Co-pilot.
I used the paid version of Claude, the free version of ChatGPT, and I have a free license for GitHub Co-pilot that GitHub gives to open source maintainers.
I wound up switching Co-pilot off fairly quickly. Not necessarily because the suggestions were bad but because it was really easy to trigger auto-complete with Co-pilot in my IDE, and I constantly wound up with clumps of code I didn't want. It was really annoying. Co-pilot seemed fairly decent at suggesting Wagtail model structures though. So, there's a chance it could be a good resource for Wagtail developers who have more patience for the auto-complete quirks than me.
The two tools I wound up using more heavily for the rest of the project were ChatGPT and Claude. I found both of them to be pretty good when it came to suggestions. I ultimately started favoring Claude though because it behaved more like a developer and was better at presenting multiple options you could choose from to tailor things to your specific project. When it comes to coding, I suspect Claude is going to be my new AI best friend.
Wagtail things AI did well
If you want to create Wagtail models completely from scratch, both ChatGPT and Claude will definitely be able to help you do that. Here's an example output from Claude for the prompt "I want you to create a Wagtail page model called BlogPage that has fields for a blog title, blog preview text, a blog image, and a blog body."
from django.db import models from wagtail.models import Page from wagtail.fields import RichTextField from wagtail.admin.panels import FieldPanel from wagtail.images import get_image_model_string class BlogPage(Page): # Blog title is inherited from Page.title # Blog preview text preview_text = models.TextField( max_length=500, help_text="Brief description of the blog post (max 500 characters)" ) # Blog image blog_image = models.ForeignKey( get_image_model_string(), null=True, blank=True, on_delete=models.SET_NULL, related_name='+', help_text="Featured image for the blog post" ) # Blog body content body = RichTextField( help_text="Main content of the blog post" ) # Define which fields appear in the admin interface content_panels = Page.content_panels + [ FieldPanel('preview_text'), FieldPanel('blog_image'), FieldPanel('body'), ] class Meta: verbose_name = "Blog Page" verbose_name_plural = "Blog Pages"
One of the things I do actually appreciate about how both Claude and ChatGPT approach Wagtail is that they include the help text feature by default. Too often, Wagtail developers forget that this feature (which can be super helpful to editors) exists. This output reminds people it's an option they can use. Claude also correctly notes that the title for this page can be inherited from Page.title. The Meta class as well also shows people some of the more commonly used settings for naming pages.
One thing that's missing here is the search index configuration, which is very important to include if you want the content in these page types to be searchable. I would like to see these AI coding tools include that configuration by default because it is more common for people to need it than not need it. There's also no example of the commonly used settings for parent pages and child pages. That's okay because BlogPage is the only page that exists in this prompt.
When it came to feeding these tools existing blocks and page types from Wagtail.org so I could create the new conference page models, I found both tools to be useful for adapting my additions to the existing code. The only quirk I noticed is sometimes fields were made optional or not optional for no good reason. Part of that was me probably not being very specific with prompts.
Overall, the AI tools were great for helping me adapt and troubleshoot the Wagtail models and blocks I added to the project. I already have a lot of familiarity with Wagtail models though, so other than the troubleshooting, these tools didn't particularly save me much more time than I would have spent stitching the Wagtail code together myself.
Wagtail things AI didn't do so well
One area I definitely need more practice in as a developer is rendering data in templates. The templates in Wagtail projects are generally pretty straightforward but they can get a little sticky when you build custom blocks and start nesting groups of fields in a block structure.
I definitely ran into some templates where the correct syntax wasn't obvious to me because of the for loops and the block types that were involved. I tried using Claude and ChatGPT to sort out what was going on, but both tools were giving me answers that are more appropriate for Django than Wagtail.
For example, let's look at this block code for the block we're using to add sponsors to a page:
class SponsorHighlightBlock(blocks.StructBlock): heading = blocks.CharBlock(max_length=255, required=False) sponsor = blocks.StreamBlock([("sponsor", SponsorBlock())], blank=True) class Meta: icon = "pick" template = ( "patterns/components/streamfields/sponsor_highlight/sponsor_highlight.html" ) label = "Sponsor Highlight"
Claude and I both failed to realize that StreamBlock uses the same template syntax as StreamField. When you use StreamField and other custom block types in Wagtail templates, you usually need to use the value property in your data variables. This is something unique to Wagtail that you won't find in Django, but Claude kept suggesting I try Django-style variables when I was using it for troubleshooting the templates. Ultimately I had to phone a friend to figure out that I needed to include value in the for statement of this template code:
{% load wagtailcore_tags wagtailimages_tags %} <div class="sponsor-card"> <p class="sponsor-type">{{ value.sponsor_type }}</p> <div class="sponsor-logo"> {% for logo in value.sponsor_logo %} <a href="{{ value.sponsor_link }}">{% image logo width-500 %}</a> {% endfor %} </div> </div>
Both Claude and ChatGPT were not particularly helpful for figuring out template data variables. Neither tool seems to understand the nuances between Wagtail and Django when it comes to templates. At least right now they don't.
The other area where AI was not particularly helpful was template tags. I wanted to use a template tag to collect the registration link for Wagtail Space from the navigation menu and use it in other places on the landing page. Once again, Claude and ChatGPT suggested a bunch of Django-based options that don't really line up with how Wagtail data is organized. The approach that ultimately worked looks like this:
@register.inclusion_tag( "patterns/components/buttons/spacereg-button.html", takes_context=True ) def get_reg_url(context): if space_menu := SpaceMenu.objects.first(): return { "reg_url": space_menu, "request": context["request"], }
That template tag is more similar to the example we have of how to include snippets in template tags than a template tag you would find in an average Django project. The AI tools had more Django examples at the ready, which is not surprising since there are loads more pure Django projects out in the world for these tools to learn from.
Overall, I think these tools don't quite have the nuance needed for data rendering and templates yet. I suspect that if I used a model that I could feed some Wagtail documentation links to, then it might have had better suggestions for me. I have no doubt these AI tools will eventually catch up to the differences. Give them a few months.
Other Wagtail things AI can't do for you
There are some Wagtail decisions that, as much as you would like to, can't be outsourced to AI yet or, honestly, ever. When you ask Claude or ChatGPT to build you a custom Wagtail block, those tools aren't going to know the best way to organize the information that works for the humans you are building the software for.
Say your human editors need to be able to add an infinite number of goofy potato memes to an image gallery. The current versions of these AI tools could propose using StructBlock, which would work and be perfectly valid code. But ListBlock uses less code and provides a slightly better user experience because of how the fields are organized in the Wagtail admin.
AI also can't tell you whether your editors think it makes more sense to have the potato meme caption come first in the order or the potato meme image. Only your editors and users can tell you how they like things to be organized and what works best for their workflows.
So, even though AI tools are pretty good at creating Wagtail models and blocks right now, it's still valuable for you to have an understanding of what the different methods are for creating custom blocks and the different panel options for organizing fields in the Wagtail admin. Because each approach will provide a slightly difference editing experience, and the experience an AI tool recommends might not be the one your editors want.
Non-Wagtail things I used AI for
I used AI for several non-Wagtail tasks during this project as well, and there were a few places where the tools were really helpful.
Claude was great at helping me generate and troubleshoot frontend styles. I saved a lot of time on those with Claude. Are the frontend styles it helped me create the cleanest and DRYest code in the world? No. But I will be stripping them and replacing them with new styles next year, so this was an area where I was okay with letting the code quality go a bit. Claude was also great for organizing and renaming styles. Once my templates were written, Claude easily extracted the class names from my templates and put them in order for me.
Claude also really shined when it came to troubleshooting all of the random build errors that crop up when you are working on a project with established linting and other checks in place. I only had one error that I had to consult a colleague on because Claude was quickly able to give me more context when I wasn't familiar with the error message.
Using Claude and ChatGPT was also fantastic for dealing with Docker and database hiccups. I usually encounter at least one random environment issue that can take hours to resolve because I am by no means a Docker expert. Claude helped me demystify the few error messages I encountered without having to go root through a swath of StackOverflow questions of varying quality.
Final thoughts
Ultimately, I feel these AI tools are a generalist's dream. Rather than having to slog through a bunch of forums, blog posts, and maintainer docs to figure out how to format a query for some random JSON tool I only use three times a year, Claude and ChatGPT give me one place to go to for high-quality information and code recommendations. Was that information always high-quality? No. You need to have at least some familiarity with building software to get the most of these tools. Reducing the number of places you need to look for ideas and solutions though definitely saves time.
There are some things I still feel a bit iffy about when it comes to using AI in my Wagtail projects. As someone who lives in North Carolina, a state in the US where data centers are rapidly appearing and starting to cause environmental and community issues, I think we need to be proactive and transparent about the environmental impacts AI tools have compared to other forms of computing. I want to see more numbers on this. After all, hopping on a video call to pair code with another developer is resource-intensive too, and I want to know how that compares to pair coding with Claude.
When it comes to Wagtail, these tools might be useful for you even if they don't quite have all the nuances between Django and Wagtail figured out yet. Go explore them. Then definitely come tell me what you like and didn't like.
The image for this article was generated with ChatGPT using the prompt "I want you to generate an image of a Wagtail bird working with a robot to build a nest. I want this image to have a futuristic feel and to incorporate colors from the following hex code palette: #262626, #2E1F5E, #007D7E, and #B3E7E8."