Agents All the Way Down: How AI Coding Agents Changed How I Write Django with Josh Thomas

This video features Josh Thomas at DjangoCon US 2026 in Chicago, Illinois, USA.

Agents All the Way Down: How AI Coding Agents Changed How I Write Django with Josh Thomas
0:24:45
Published October 26, 2026
200 views

I'm the lead developer at a company with about 10 Django applications. The biggest is a 19-year-old legacy application that's been ported from ColdFusion to WordPress to a custom PHP system to Django. It's full of boolean fields that should be foreign keys, invariants that live in developers' heads instead of model constraints, and business logic that predates Django's existence. I've been using coding agents on this codebase and others for the past year, mostly Claude Code.

The most interesting result isn't speed. What actually changed is how I write Django. I lean harder into the ORM, encoding invariants in model relationships instead of application logic, because agents are good at following the framework's conventions and bad at following mine. I build less custom scaffolding, and when I do, I build it out of wood instead of concrete, designed to be torn down as the tools improve. I got my test suite runtime as low as possible, because a fast feedback loop is the difference between an agent that can verify its own work and one that's guessing.

Most advice about coding agents is "here's how to prompt better." This talk is about how working with agents changes the way you structure a Django project. I'll cover where agents help with legacy code, where they fall down specifically with Django (migrations, multi-app relationships, project conventions), and the feedback loop: you reshape the codebase for agents, and that reshaping makes the code better for humans too.

This talk is for Django developers who are past the "wow, it wrote a function" phase.

This talk was presented by Josh Thomas at DjangoCon US 2026 in Chicago, Illinois, USA
https://2026.djangocon.us/talks/agents-all-the-way-down-how-ai-coding-agents-changed-how-i-write-django/

LINKS:
Follow Josh Thomas 👇
On Mastodon: https://joshthomas.dev/@josh
Website: https://joshthomas.dev

Transcript

4,160 words · auto-generated · en Show

Automatically transcribed, so expect mistakes in names and technical terms.

0:14

All right, thank you everyone. Um earlier this year I was at Disney World on a vacation with my family. I don't remember whether we were walking around Magic Kingdom or already in line for Tiana. uh Tiana's Bet Bayou Adventure when a message from work showed up on my phone. But I know it was on vacation and I was nowhere near my laptop. At work, our lease managers use one of our applications to send hunting club lease contracts to an outside contract service. Someone from our team messaged me because one of those contracts had failed twice. The application said it couldn't find one of the maps it needed to build the contract. That error usually means what it says. Our land information services team generates the maps and puts them on the network.

1:03

And I have a cron job that runs every 30 minutes and copies them up to S3. And that's where our lease application can read from them. Some of our lease managers, I'll admit, are a little trigger happy. They'll create a tract and immediately put on a lease and then try to send the contract before any of that has run I had seen that plenty of times before, and so that was kind of my first guess. I checked the audit log for my phone and the timing suggested the map should have already made it into the application. So my obvious explanation didn't fit and I didn't really have a better one yet. At Westervelt, we're a two-person development team. And unfortunately, the other developer was unavailable that day, so it was on me.

1:48

We work with contractors too, but getting them into a production bug like this is not immediate, so it wouldn't have fixed the issue. Before I left for vacation, I had actually set up Codex in the remote mode on a new Mac Mini , but I hadn't really used it yet, and certainly not on a real bug. So I figured Why the hell not? Um I pasted in the team's thread, the error, what I'd found in the audit log, and my basic idea of what might be happening. Then I asked it to investigate on a new branch and see if it could come to a small fix. It went off and churned for a few minutes and then came back with two changes and some tests. One looked like a useful fix around the map, um, the map lookup. Uh but the second fix it had looked more like the bug we were chasing.

2:35

Um both patches were small and the diff looked reasonable and fine. Unfortunately, Codex couldn't run our test suite because uh this was a fairly new Mac Mini. I hadn't actually set up Docker yet. The tests it wrote didn't pass my smell test either. You know, any third-party integration requires probably a little bit amount of mocking, but agents left of their own devices will just mock endlessly. I pushed back and asked for a more realistic regression test without bending ourselves into knots or excessive mocking. Everyone that kept a stale object in memory changed the real state in the database underneath it and then showed that the background job reloaded the object before descending the contract.

3:21

That looked much more like the bug we were trying to fix, and so I asked Codex to push everything up. I opened the pull request and let CI do its thing. It passed. I gave the diff uh one more once over in the GitHub app on my phone as a sanity check and then merged it. I knew if the patch didn't fix the issue, we would be in the same place we already were in. I also knew it wasn't going to bring down production. The lease manager ended up trying again and the contract went through. The Codex app part of this felt new and surprisingly polished, but the process was what I would normally do with my laptop. Think through a problem, guide the agent. push back where I needed to wait for CI and decide whether the whether to merge. I spent maybe twenty minutes on it in pieces while I waited in line with my family

4:10

instead of losing hours on our of our vacation Going back to the hotel and dealing with it on my laptop. Codex moved that work kind of onto my phone, but the process I was following had taken me six years to build. So I'm uh Josh, like I said, I'm the lead developer at the Westerveldt Company, a land and lumber company in Alabama that's been around for more than 140 years. We have about 10 Django applications covering everything from mill safety to mineral payments and bookings for our hunting lodge. The lease application from the Disney Story is the biggest. It manages leases across hundreds of thousands of acres, and it's roughly 19 years old.

4:57

I've been a professional developer for about six years, all of them at Westerveld. And this was my first job writing software for a living. For a while I was the whole development team. I was the developer, designer, QA, DevOps, product manager, and the person talking to our users I was also learning all of those jobs while I was doing them. The software I inherited was a mixture. We had some WordPress and some cold fusion applications built inside the company. that weren't in version control. We also had applications bit by built by contractors. Those were in Bitbucket, but when the contractors needed to deploy one, they sent us a zip file and we copied it onto the Windows Server and restarted the web

5:43

service. So I did what I thought any normal developer should do. I created a GitHub organization, got access. to the contractor repositories and moved them into our account and then started the hard work of bringing in tests, CI, and automated deployments. None of that truthfully was actually in my job description and no one had really asked me to do it. I just it was how I understood how modern software should be built, and I was lucky enough that my boss gave me enough room to do it My first GitHub Actions workflows were over-engineered and sometimes very flaky, but the goal was simple. I was new, responsible for all of it, and wanted enough evidence around a change that I could sleep after deploying it.

6:28

Once tests and deployment moved into CI, deploying became just merging a pull request I had trusted. That was leverage. The same work still happened, but I no longer had to carry each step myself. I learned most of this job while doing it and by reading a lot of open source code. I would not be standing here without open source. By the time the first AI coding agents showed up, or coding tools showed up, I had a pretty clear standard of what a useful tool is. If it was going to take, if I was going to make room for it in my day, it needed to take some real work off my plate. Chat GPT and the browser required too much copying back and forth. Copilot and the other tab completion style

7:14

AI sat closer to the project, but they interrupted me, interrupted my flow without taking enough work off my plate. Then I tried ADER. I don't know if anyone remembers ADER. It was doing the Cloud Code thing before Clod Code, running in the terminal, reading and editing files, working inside the project. Cloud code went further by finding its own context, running commands, reading the result, and continuing the loop. These tools could finally take a task through the development loop I had already built. That connection for me was the leverage. CI had moved repeatable work out of my hands and an agent could take the first pass at work that wasn't repeatable. It could take a bug report, inspect the project, and bring me back a possible cause before I'd even

8:03

uh before I'd give in the rest of my day to it. Even when the diagnosis was wrong, it could roll out something or give me a place to start. And that's what happened at Disney. I spent about twenty minutes of my own attention instead of a few hours back at the hotel. I stayed with my family and the contract still went out. But those are two different kinds of leverage. CI is supposed to be deterministic and an agent definitely isn't. That unpredictability is part of why it can investigate a problem, come up with a novel solution, but it's also part of why I can't trust it in the way I trust a CI runner. So yeah, CI CI can tell me that all the tests pass, but the tests can all pass while the data model is still wrong.

8:50

And this is kind of where my own Django code has changed the most over the years, is in the models. I've started paying much more attention to whether the whether the business relationships are actually visible there. or whether they only make sense after someone explains them. Carlton Gibson has a saying, go with the grain of Django. Django has 20 years of conventions around it, how its applications are laid out and how all the various pieces fit together. There are 20 years of documentation, tutorials, Stack Overflow answers. and many, many open source projects. Django itself is in the training data and it's one of the main projects used in all the benchmarks that suites the benchmark suites that uh labs use to test the coding agents.

9:37

So agents know Django very well. The farther an application gets from it, the more context you kind of have to supply. But going against the green isn't automatically wrong. For example, I tend to put my service layer. Type code and custom model managers and query sets. To me, that feels like going with the grain of Django. But agents love creating a services. py file or a separate service module. instead. And I'm sure there's plenty in this spee people in this room that prefer that as well. I still think my way is right. But both can produce clear code and fighting the agent over every session doesn't buy me much. Django has a grain and agents have a grain too.

10:23

So I've learned to loosen my grip when the difference is mostly taste. But taste can still carry information. Charlie Marsh, who created UV and Ruff and is now an open AI employee, has posted the same joke twice. This bull could have been an enum. A Boolean makes the surrounding code explain what's what true and false mean. And an enum names the values and has somewhere to put a third state if it uh shows up. That's partly taste, but I think it's useful taste. The lease application had a much bigger modeling problem than just a simple enum Boolean comparison The application started as an access database 19 years ago. It moved through a Cold

11:09

Fusion application written mostly in Raw SQL and eventually became Django. The older design used fairly flat tables, and at the time that made sense. DirectSQL and flat rows can be simple, but after 19 years of features and changes. Some of the business relationships were just hard to see. For instance, a hunting lease can cover several tracts of land, and one of them has to be the primary tract. Other parts of the business use that track to identify the lease and connect it to a landowner and perform financial transactions. And so this is what it looked like before. The old model stored is primary as a boolean on each tract assignment.

11:54

If at least covered five tracks, then there were five rows, and one of them was only supposed to say true. We later added a constraint so no more than one active track for the same club and year could be primary, and that helped. But the lease itself still had no relationship to follow. To find its primary tract, the code had to work back through the club, the year, active status, and all the tract assignments for the lease. A person onboarding to the code base learns that rule once and remembers it. An agent wakes up every session having to relearn the entire world. Every time one touched this part of the application, I had to make sure it reconstructed that same answer in its context.

12:41

And here's the thing, I already knew that model was awkward for years. I got very good at writing custom model managers and query sets to smooth over those inherited relationships. And changing the model was not impossible, but external reports and power BI integrations, um, read those tables directly. A schema change meant coordinating with people outside the application, which was enough friction for the workaround to keep winning. It was easier to teach the human developer the rule once and just let them keep moving. The refactor, so the refactor was already on my list, but having to teach the same rule over and over again to every new agent was what finally pushed me to do it. So

13:26

uh we added primary tract as a foreign key on the lease and wrote a data migration for the old rows. It only set uh the primary tract when it could find an act uh matching active track, so rather than guessing um the new field is still nullable. And some old lookup behavior remains around that for this reason same reason. So the model is not perfect and the database does not prevent every invalid state. But now the first answer to what is this lease's primary tract is lease. primary tract. Relationship is written down where you would expect to find it on the lease. Now an agent can find that relationship without as much explanation. That also helps the next person work on the application, including me, six down six months down the road.

14:13

More generally, when an agent keeps getting something wrong, I ask myself, what kind of a disagreement are we having? Is that fighting a harmless preference Like where I put a service function. Is it struggling with information poor representation like a misplaced boolean field? Or is it repeatedly reconstructing a fact the application should state directly? If it's a domain fact, I look for a model, a relationship, or a constraint that can say it. If it's a code smell, maybe it becomes a lint rule or a Jenga system check. And if it's just taste, I've learned to just let that go sometimes. When I find myself typing the same business rule into prompt after prompt, I don't want to solve that with a better prompt.

14:59

I want the next agent to be able to find the rule in the code. None of this means that the agent will choose a better data structure on its own. When the code leaves room for an easy answer, it usually takes it. So slop's a big word these days, slop's a word everybody uses for bad agent code. And what I mean by it in this talk is that it's code that looks plausible and solves the problem sitting on the surface. It may pass every test. It may even work in production. But it solves the problem in front of it without dealing with the larger problem underneath. Earlier this year, Brian Cantrell wrote a post called The Peril of Laziness Lost. It starts with Larry Wall's three virtues of a programmer: laziness, impatience, and hubris

15:46

Cantrell argues that laziness is the most important one. We do hard design work now because we don't want to have ourselves or the next person have to keep paying for that same awkward design later. His shortest version of what agents lack is this. Work costs nothing to an LLM. An agent never has to maintain 200 lines. It just added, it never gets tired of working around the same bad interface. It doesn't feel the code base getting harder to hold in its head because it doesn't have to hold that code base in its head tomorrow. It doesn't have a head. So it takes a local fix. If the tests fail, it changes the code until they pass. If writing a pile of mocks to get them to pass, it will write that pile of mocks. And an agent can write both the implementation and the tests.

16:33

So that means it can write tests that prove the solution it's already chosen. Once the solution is in is in the code base, it becomes a fact for the next agent. Agents are much more likely to accept an existing pattern than to stop and ask whether That pattern should exist in the first place. So slop compounds. A bad, small, bad choice gets copied into the next feature and the next one until it becomes just how the application works. An old application gives the agent even more mixed evidence. The lease application contains choices made at different times by different people for different reasons. Some are deliberate, some are inherited, and some remain because changing them would break something.

17:22

An agent sees all of this as equally real. When the code gives it mixed answers, it tends to reach for the most common answer it's seen elsewhere. I tried using agents to solve this. I'll send an implementation through an adversarial reviewers. That helps until the implementing agent. treats every criticism as an order. A reviewer told to find complexity will find some. And a five-line fix can become 200 lines of defensive checks that are unlikely or impossible. The reviewer has the same missing judgment as the implementer. It gives me another opinion without telling me how much that opinion matters. So I treat it as one more check. Tests catch behavior that we knew to test.

18:07

Winters catch patterns we already rejected. CI runs those checks every time, and reviewers may catch something that another agent missed. Human review is still where I decide where the design fits the application. How carefully I read depends on what the change can hurt. If an agent writes a one-off script, then only I will run. I may glance at the shape, run it, and see what happens. But if that script's going to run every day as a scheduled job, then I'll read it a little bit deeper. If it changes a core model or a path our users depend on, I will read it with a fine-tooth comb. That's how I looked at the Disney patch. I knew the code. The patch was small. CI passed. If it had failed, the contract would still be stuck.

18:54

I could see that it would not bring down production. I could also not reconsider the whole integration from my phone. and um think about a potential lower rewrite. And I still haven't done that deeper redesign to be honest. What I established from Disney was that the patch was safe enough for that one incident. Um and maybe one day I can stop reading the code. Current agents have not earned that from me. After about three years, this kind of failure mode that they have has not gone away. Some weeks working with them is genuinely fun. Other weeks I correct the same mistakes over and over again until I wonder why I'm doing this.

19:39

But then I step back and I compare that annoyance with how work used to feel. A bug report would land on an already full plate and displace something else. Now an agent can do the first investigation and give me some idea of the cause and size before I decide how much attention it needs I spend less time anxious about everything waiting for me and more time annoyed at the agent in front of me. And so far I can um I can live with that trade. One reason I keep making that trade is because agents have changed what I've uh can afford to do in my spare time. I've been working on a Django language server. Um so Django normally finds bad template tags by Running the template through the template renderer. A language server needs to find it while you're still editing.

20:24

One version used tag validation rules and Toml files. The version I'm working on now actually scans the Python AST, finds where the exception is raised, and then traces it back up there to the condition that led to it. In theory, that works for both built-in tags and custom tags in anybody's project. It's still a work in progress, though. And if I had to do it all by hand right now at night, I probably wouldn't, to be honest. I love writing software and solving problems, but every evening I would spend on this is time I'm not spending with my family. Agents let me keep the project moving without letting it take over every evening. They also let me build rough versions of six possible designs instead of just comparing them only in my head. I can run them, read them, and pick out and keep the best parts.

21:13

And that gives me better evidence, but the experience is different than working from through, excuse me. The experience is different from working through one version by hand. A few years ago I read crafting interpreters and actually ended up writing a parser for Django templates. And because I wanted to learn how compilers worked and I wanted to understand deeply the Django template engine and I ended up writing it in Rust because I wanted to learn a new language. It's a new challenge, and the challenge was part of the fun. An agent could get surprisingly far on that parser, probably finish it in just a few minutes these days. But I can still write something by hand when learning is the point. Working with agents is, to be honest, also kind of a puzzle.

22:00

During a good week, I enjoy finding one uh where one failed. Writing a better check or lint rule, changing the shape of the code, and seeing what the next improv uh attempt improves. What frustrates me though is how temporary some of that learning is. The compiler concepts I learned building that template parser still apply. Something I learned about steering one model away, uh steering one model may stop working when the next one ships, and I find that incredibly frustrating and sometimes a little disheartening. There's also, to admit, some cognitive debt in that. I write code by hand much less often than I used to If these tools disappeared tomorrow, I could still do the work, but it would take me a while to get back to my old speed.

22:48

That's a real cost. At the same time, I spend much more time comparing designs. thinking about boundaries, reviewing architecture, and deciding which problem is worth solving. And I don't know how much of that comes from just using agents or just how much of it how much of it comes from that many more years of experience. Jeffrey Litt uses the phrase: understand to participate. I need to understand the project well enough to decide what happens next instead of handing the work to an agent and watching it build something for me. That doesn't make like the craftsmanship and um building opposites, though. The business cares whether the application solves its problem.

23:33

But it also cares when a bug takes three weeks to fix or a feature is too dangerous to change. Clear, changeable code is where those concerns meet. And at the end of the day, the judgment is what remains mine. At Disney, it meant deciding that a small patch was safe enough for the incident. Uh in the primary track refactor, it meant recognizing that the rule belonged on the lease instead of in queries and in people's memory. An agent could still write the code for either change. I just had to decide what the application should be. say and what risk I was willing to take. Getting the data structures right has always mattered. If you're coding with agents, though, I think it matters even more these days because when you get that right, the agents can fly

24:22

And I'll just close with this classic quote from Fred Brooks. Show me your flow charts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won't usually need to see your flow charts. They'll be obvious. Thanks.

Presenters

Conference

DjangoCon US

August 24 - 28, 2026

Chicago, Illinois, USA

Note: We understand that names change, people change, and bodies change. We respect each individual's journey and privacy. If you have any concerns about a video or need us to remove content, please don't hesitate to contact us. We will handle your request with care and promptly address any issues.

More videos by Josh Thomas

More videos from DjangoCon US