Your Models Know Their Own Schema. Let Them Show You.
You know the drill. Sprint planning is tomorrow and someone asks "can you send over the schema?" So you open your diagramming tool, spend two hours dragging boxes and drawing arrows, get it looking pr
jeffield.hashnode.dev4 min read
Archit Mittal
I Automate Chaos — AI workflows, n8n, Claude, and open-source automation for businesses. Turning repetitive work into one-click systems.
Django's model introspection is super underused for this exact kind of tooling — every ops team ends up hand-maintaining an ERD that drifts the moment someone adds a migration. One nice extension: combine _meta.get_fields() with Django's app_label grouping, then spit out Mermaid ER syntax so it renders natively in Markdown docs and Hashnode articles. For clients on large legacy schemas we also inject foreign_key reverse relations, which the default schema view usually misses. Did you consider exposing it as a management command so CI can snapshot the schema on each migration?