finds.dev

HackSoftware/Django-Styleguide

Django styleguide used in HackSoft projects

View on GitHub

★ 6,299PythonMITupdated Sep 2025

// the take

A style guide (not a library) from HackSoft laying out an opinionated way to structure Django/DRF projects around thin models, service functions for writes, selector functions for reads, and API views stripped of business logic. It's for teams building non-trivial Django APIs who are tired of fat models, fat views, or logic scattered across serializers and signals.

The service/selector split is explained with real trade-offs, not dogma — it tells you when a model property or custom manager is fine and when it isn't, instead of a blanket 'never do X'. Code examples are pulled straight from a companion reference project (Django-Styleguide-Example) so you can see the pattern in a full app, not just snippets. It's kept current with Django itself — e.g. calling out that `full_clean()` started checking constraints in Django 4.1, which changes the constraints-vs-clean-validation trade-off it recommends.

It's a markdown document with zero enforcement — there's no linter, no mypy plugin, no cookiecutter template shipped in this repo to make anyone actually follow the conventions; discipline comes entirely from code review. Several of its own rules contradict in practice: it says services should be simple `entity_action` functions, then spends a section justifying class-based services for 'flows,' with no clear line for when to switch. Guidance leans on 'use your best judgement' in the exact spots (model property vs. selector, clean() vs. service validation) where teams most need a firm rule to avoid bikeshedding in review.

We read the README, the directory tree and a key source file in September 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
6,299
Forks
622
Language
Python
License
MIT
Last commit
25 Sep 2025

// nearby

If Django-Styleguide isn't quite it.

All repos →