Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
  1. Home
  2. Blog
  3. The Patterns We See Most
Python & Django

The Patterns We See Most

The mistakes we see most in business Python code: bare exception handling, no monitoring, credentials in the repository, no tests and query multiplication.

Updated 2 min readBy SpiderHunts Technologies

Free estimateNo obligation

Get a free estimate

Tell us what you need. A senior engineer reads every enquiry.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →

Quick answer — TL;DR

No error handling, no monitoring, credentials in the repository, no tests, and query multiplication. Those five appear in most inherited systems.

The five most common

  1. No error handling beyond the happy path
  2. No monitoring, so failures are silent
  3. Credentials in the repository
  4. No tests, so nobody dares change anything
  5. Query multiplication — one query per row in a loop
The second costs the most over time. A system that fails silently produces wrong data for weeks before anyone notices, and by then the downstream effects are considerable.

Five more

  • Dependencies never updated, until they cannot be
  • Configuration hard-coded, so environments differ
  • Everything in one module, so nothing is testable
  • Bare exception handling that swallows real errors
  • No idempotency, so retries create duplicates

Bare exception handling deserves its own mention

Catching every exception and continuing hides the failures you most need to see. It turns a loud problem into a silent one, which is the wrong direction.

Catch what you expect and can handle. Let the rest surface, be logged and alert somebody.

The costs

MistakeTypical cost
No monitoringWeeks of wrong data
No error handlingOne bad record stops everything
Credentials committedA security incident
No testsChanges take three times as long
No idempotencyDuplicate records, hard to unpick

They are all cheap to fix early

Every one of these takes hours to address during development and days or weeks to retrofit. None of them requires a rewrite.

If you have inherited a system with several of them, address monitoring and idempotency first — they prevent the most damage.

FAQ

Frequently asked questions

The questions readers ask us after this guide.

Still have a question?

Ask us directly — a senior engineer will get back to you.

Ask about your project

Which should we fix first?

Monitoring, so you know what is happening. Then idempotency, so retries are safe.

How do we know if we have these?

An hour reading the code answers most of it. Look for exception handling, configuration and query patterns.

Can these be fixed incrementally?

Yes, all of them. None requires a rewrite, which is worth knowing before anyone proposes one.

What if the original developer is gone?

That is the usual situation. These are all identifiable from the code without needing the author.

Keep reading

More on Python & Django

Python & Django

An API Other Systems Can Depend On

Designing a Python API service others can depend on: validation at the boundary, consistent errors and status codes, early versioning and documentation.

Python & Django

Moving and Transforming Data Reliably

Building data pipelines in Python that cope with malformed input: restartable stages, quarantining failures, reconciling counts and alerting on absence.

Start here

Recognise more than three of these?

Most inherited systems have them. Monitoring first — it tells you what else is wrong.

  1. You tell us what you needTwo minutes on the form, or a message on WhatsApp.
  2. A senior engineer reviews itAnd comes back with questions, a realistic range and an honest view on fit.
  3. Free 30-minute scoping callWe talk through scope, options and a realistic estimate — with no obligation.
Free estimateNo obligation

Talk to someone who builds this

Send a short brief and we will come back with an honest view and a realistic range.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →