Stop relying on discipline: Pre-commit hooks that catch Django problems early
Speaker: Mohammad Abu Khashabeh 14:55 stage 🎤
Has a manage.py check failure ever reached your staging environment? Or a migration that was written but never applied? Pre-commit hooks turn these from “we’ll catch it in CI” into “the commit is blocked until it’s fixed.” This talk gives you a complete, layered stack: generic hooks, then pyupgrade, black, isort, autoflake, flake8, bandit, mypy — plus exclusions for migrations and tests, and how to add manage.py check as a local hook. Copy-paste friendly, works in legacy codebases, and you leave with a config you can use that afternoon.
Pre-commit hooks are not magic — they are a gate, and gates only work when you put them in the right place. This talk walks through the full mental model: what to run on every commit, what belongs in CI instead, and why the order of hooks matters.
We cover the stack from generic repo hygiene (whitespace, merge markers, secrets detection) through Python formatting and linting, to Django-specific local hooks that run manage.py check — and optionally your tests — before any commit lands. We also cover incremental adoption: how to introduce this into a legacy Django codebase without breaking the team’s flow. Every hook comes with its exclusion rationale, including why migrations are excluded from mypy and why tests get different linting rules.
About Mohammad
Mohammad is a senior and lead software engineer from Amman, Jordan. Over eight years in, most of them spent deep in Python and Django — designing backend systems, jumping into frontend when the work demands it, and handling DevOps when nobody else will. He’s genuinely passionate about the space where development and operations meet, and spends a lot of time thinking about what happens after git push.
He leads teams, mentors developers, publishes open-source packages including django-easy-softdelete, numwordify, and django-ask-ai on GitHub, and writes about what he learns on Medium. To get to this talk, he flew from Amman to Copenhagen. His first international conference talk. Worth it.