# My experience with django-mptt

DevFeed: [My experience with django-mptt](<https://devfeed.tech/articles/my-experience-with-django-mptt-35435.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/my-experience-with-django-mptt/>)

Author: Graham King

Published: 2011-04-29T23:57:41Z

Content type: opinion

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [Django](<https://devfeed.tech/topics/django.md>), [Maintainability](<https://devfeed.tech/topics/maintainability.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [Processes](<https://devfeed.tech/topics/processes.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>)

Tags: [concurrently](<https://devfeed.tech/tags/concurrently.md>), [database](<https://devfeed.tech/tags/database.md>), [django](<https://devfeed.tech/tags/django.md>), [maintainability](<https://devfeed.tech/tags/maintainability.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [processes](<https://devfeed.tech/tags/processes.md>), [python](<https://devfeed.tech/tags/python.md>), [software](<https://devfeed.tech/tags/software.md>), [speed](<https://devfeed.tech/tags/speed.md>)

## AI overview

The author shares experience maintaining two Django projects that used django-mptt, a toolkit for adding tree structures to Django models. The article argues that django-mptt's automation can obscure behavior and increase complexity, and recommends starting with a self-referential foreign key and adding mptt only when its performance benefits justify the maintainability cost. It also discusses using raw SQL for bulk imports, avoiding concurrent object creation that can cause deadlocks, and rebuilding trees afterward.

## Source excerpt

"Navigating the forest of django-mptt: A cautionary tale"