Building a Coding Agent: Python/Django Edition
Building a Coding Agent: Python/Django Edition
Watch the recording
Full workshop video with timestamps and downloadable materials.
Follow the tutorial
11 pages of step-by-step instructions you can work through at your own pace.
We build a small project bootstrapper for Django: a coding agent that takes
a plain-language app request, copies a working Django template, reads and
writes files through tools, and iterates until the generated app runs. The
first implementation uses the OpenAI Responses API through ToyAIKit, then
we try the same idea with OpenAI Agents SDK, PydanticAI, Anthropic, and
Z.AI.
Links
The main resources:
- Workshop recording
- Workshop code
- ToyAIKit
- Django template repo
- Todo app made with Z.AI
- Related course: AI Bootcamp: From RAG to Agents
- Related workshop: Hands-on with AI Agents and MCP
The app you will build
The coding agent is a notebook-based chat interface backed by an LLM and a
small set of filesystem tools. You give it a request like to-do list.
The agent edits a copied Django template and leaves you with a project you
can run.
Two screenshots show what the finished workshop output looks like. The first one shows the notebook chat after the agent plans and starts calling file tools:

The second one shows one of the generated Django todo apps:

Walkthrough
Follow the numbered files in order. Each file is self-contained enough to read on its own, but the steps build on each other.
- Overview and setup - what we are building, prerequisites, OpenAI key setup, Codespaces notes, and package installation.
- Part 1: OpenAI function calling recap - a quick OpenAI Responses API recap with a joke function, tool schema, and the model choosing a tool call.
- Part 2: ToyAIKit runner - use
ToyAIKitto run the same tool-calling example through a notebook chat interface. - Part 3: Django template - use a working Django template as the starting point, with both clone-and-run and build-from-scratch paths.
- Part 4: File tools - create the file tools the coding agent can call: read, write, file tree, bash command, and search.
- Part 5: Developer prompt - write the developer prompt that tells the agent what project it is editing and how to behave.
- Part 6: Run the coding agent - run the first coding agent with
ToyAIKit, look at the generated todo app, and iterate when a generated feature does not work. - Part 7: OpenAI Agents SDK - switch the runner to OpenAI
Agents SDK, wrap the same tools with
function_tool, and run the Django agent again. - Part 8: PydanticAI, Z.AI, and next steps - try
PydanticAI, Anthropic Claude, Z.AI through chat completions, and the multi-agent direction from the extra notebook. - Q&A: side discussions - side discussions: Jupyter, templates, open-source models, MCP, production agents, API keys, streaming, timeouts, and notebooks.
- Appendix: file inventory - file inventory for the workshop code and the Django template.
Result
The simplest version is intentionally small. It runs in Jupyter, uses local filesystem tools, and edits one copied Django project folder. That is enough to understand how larger coding agents work under the hood: prepare a template, expose the right tools, give the model precise instructions, and iterate on the generated code.
Tutorial pages
- 1 Overview and setup
- 2 Part 1: OpenAI function calling recap
- 3 Part 2: ToyAIKit runner
- 4 Part 3: Django template
- 5 Part 4: File tools
- 6 Part 5: Developer prompt
- 7 Part 6: Run the coding agent
- 8 Part 7: OpenAI Agents SDK
- 9 Part 8: PydanticAI, Z.AI, and next steps
- 10 Q&A: side discussions
- 11 Appendix: file inventory