Trees and Graphs
Even in relational databases, Django can easily do hierarchical data models. http://science.nasa.gov/ is a good example of what can be done.
Search & Filter
| Package | django-mptt | django-treebeard | django-treenode | django-tree-queries | django-polymorphic-tree | django-neomodel | django-ltree | django-ltree-2 | django-postgresql-dag | django-fast-treenode |
|---|---|---|---|---|---|---|---|---|---|---|
|
Description
|
Utilities for implementing a
modified pre-order traversal tree in django. |
Efficient tree implementations
for Django |
:deciduous_tree: probably the
best abstract model/admin for your tree based stuff. |
Adjacency-list trees for
Django using recursive common table expressions. Supports Postgre… |
Polymorphic MPTT tree support
for models |
Neomodel plugin for Django
|
An ltree extension
implementation to support hierarchical tree-like data using the native … |
Postgres LTree support for
django |
Directed Acyclic Graphs with a
variety of methods for both Nodes and Edges, and multiple e… |
A hybrid, high-performance,
open-source framework for working with large trees in Django |
|
Category
|
App | App | App | Other | App | App | App | App | App | App |
|
Using This
|
113
|
27
|
3
|
2
|
4
|
1
|
0
|
0
|
2
|
0
|
|
Python 3?
|
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
Dev Status
|
Production/Stable | Production/Stable | Production/Stable | Unknown | Production/Stable | Beta | Beta | Production/Stable | Production/Stable | Production/Stable |
|
Version (PyPI)
|
0.18.0 | 5.2.2 | 0.24.0 | 0.24.0 | 2.1 | 0.2.0 | 0.6.0 | 0.1.13 | 2026.2.3 | 3.2.10 |
|
Stars
|
2,976 | 1,206 | 798 | 514 | 170 | 311 | 75 | 48 | 53 | 37 |
|
Forks
|
463 | 224 | 39 | 32 | 41 | 61 | 18 | 6 | 6 | 6 |
|
Commits
|
|
|
|
|
|
|
|
|
|
|
|
Updated
|
2 Jun 2026 | 5 Jun 2026 | 11 May 2026 | 9 Jun 2026 | 3 Jun 2026 | 27 Jan 2025 | 13 May 2026 | 9 Jun 2026 | 19 Feb 2026 | 22 May 2026 |
|
License
|
MIT-License | Apache-2.0 | Custom | BSD-3-Clause | Apache 2.0 | MIT | MIT | MIT | Apache-2.0 | Custom |
|
Links
|
||||||||||
|
Feature Comparison
(click cells to edit)
|
||||||||||
|
Type: Adjacency list
|
|
|
|
|
(based on django-mptt)
|
—
|
—
|
—
|
—
|
|
|
Type: Nested set
|
|
|
—
|
|
|
—
|
—
|
—
|
—
|
|
|
Type: Materialized path
|
|
|
|
|
(based on django-mptt)
|
—
|
—
|
—
|
—
|
V 3.x |
|
Uses native graph storage
|
|
|
—
|
|
(based on django-mptt)
|
—
|
—
|
—
|
—
|
|
|
Admin contrib support
|
|
|
|
|
|
—
|
—
|
—
|
—
|
|
|
Dependency Free
|
|
|
|
|
mptt
|
—
|
—
|
—
|
NetworkX for exports, PostgreSQL
|
|
|
Type: Directed Acyclic Graph
|
|
|
—
|
|
|
—
|
—
|
—
|
|
|
|
Drop-in
|
|
|
—
|
|
|
—
|
—
|
—
|
—
|
|
|
Type: Closure Table
|
—
|
—
|
|
—
|
—
|
—
|
—
|
—
|
—
|
V 2.x |
|
Type: Edge list
|
—
|
—
|
—
|
—
|
—
|
—
|
—
|
—
|
|
—
|
|
API-First support
|
—
|
—
|
—
|
—
|
—
|
—
|
—
|
—
|
—
|
|
Utilities for implementing a modified pre-order traversal tree in django.
Efficient tree implementations for Django
:deciduous_tree: probably the best abstract model/admin for your tree based stuff.
Adjacency-list trees for Django using recursive common table expressions. Supports PostgreSQL, sqlite, MySQL and MariaDB.
Polymorphic MPTT tree support for models
Neomodel plugin for Django
An ltree extension implementation to support hierarchical tree-like data using the native Postgres extension ltree in django models
Postgres LTree support for django
Directed Acyclic Graphs with a variety of methods for both Nodes and Edges, and multiple exports (NetworkX, Pandas, etc). This project is the foundation for a commercial product, so expect regular improvements. PR's and other contributions are welcomed.
A hybrid, high-performance, open-source framework for working with large trees in Django
V 3.x
V 2.x
Showing 10 of 17 packages in this grid.
Features Being Compared
Type: Adjacency list
Type: Nested set
Type: Materialized path
Uses native graph storage
Admin contrib support
Django Admin contrib integration.
Dependency Free
Thirdparty depedency required for package.
Type: Directed Acyclic Graph
Drop-in
Doesn't require building models using utils provided within package. Works with previously created models.
Type: Closure Table
Type: Edge list
Is the graph or tree stored in the database as a list of edges from a parent node to a child node?
API-First support
API-First support means the backend is built to provide a complete, standalone API, enabling external systems or frontends to interact without relying on internal UI logic.