Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
  1. Home
  2. Blog
  3. Getting the Numbers Out
Python & Django

Getting the Numbers Out

Reporting in Django applications: define each figure precisely, use replicas or aggregate tables, deliver reports automatically and respect permissions.

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

Define the numbers precisely, run reports against a replica or aggregate tables, deliver them rather than requiring people to fetch them, and make them exportable.

Define the numbers before building

Automating a report requires stating exactly what each figure means: which date it is counted on, how cancellations are treated, what is included and excluded.

Two reports disagreeing because they define revenue differently is the fastest way for a business to stop trusting its own reporting.

Do not report from the operational tables

  • Heavy aggregations slow the application for everyone
  • Use a read replica, or nightly aggregate tables
  • Pre-compute anything expensive that changes infrequently
  • Paginate or stream anything large

Deliver rather than display

  1. Scheduled email with the key figures, before people need them
  2. Alerts when something is outside its normal range
  3. The detailed view available for anyone who wants to dig in
  4. Everything exportable, because people will want it in a spreadsheet

A dashboard people must remember to open is opened in the first week and rarely afterwards. A short email arrives and gets read.

Make them reproducible

RequirementWhy
Same inputs give the same outputTrust
Explicit date rangeComparability
Definition documented alongsideNobody guesses
Historical periods regenerableAuditability
ExportablePeople want the data

Respect permissions in reports

A report that ignores the permission filter leaks everything the interface carefully restricted. Exports are the most commonly forgotten path.

Apply the same filtering to reports and exports as to screens, enforced centrally rather than remembered.

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

Should we use a BI tool?

For exploratory analysis, frequently. For a fixed set of operational reports, building them directly is simpler and faster to load.

How do we stop reports slowing the app?

Run them against a replica or aggregate tables. Never heavy aggregation against live operational tables.

Who defines the metrics?

The business, in writing, before building. Technical people should not be deciding what revenue means.

How many reports?

Fewer than you think. Five that are read beats thirty that are not.

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

Reports nobody opens?

They probably need to arrive rather than be fetched. Happy to look at what your business actually reads.

  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 →