Skip to main content

Generate diagrams showing relationships between templates in Django projects

Project description

Generate diagrams showing relationships between templates in Django projects


The full documentation is at


Install django-template_tree:

pip install django_template_tree

Add it to your INSTALLED_APPS:


Add django-template_tree’s URL patterns:

from template_tree import urls as template_tree_urls
from django import settings
if settings.DEBUG:
    urlpatterns += [
        url(r'^__tt__/', include('template_tree.urls', namespace='template_tree')),


Displays a collapsible tree diagram showing the hierarchy of templates used by a Django application.


Nodes can be collapsed and expanded, by clicking on them.


Apps can be filtered out of the tree, using the ‘exclude_app’ querystring parameter, thus:


By default, admin is excluded, so http://localhost:8000/__tt__/ is equivalent to http://localhost:8000/__tt__/?exclude_app=admin

In order to show the admin app as well, you will need to ‘unexclude’ it thus: http://localhost:8000/__tt__/?exclude_app=

Visiting the template_tree url, requesting an application/json response will return json data compatible with d3 hierarchies, so you can roll your own diagrams.

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox


Tools used in rendering this package:


0.1.0 (2018-01-06)

  • First release on PyPI.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-template-tree, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size django_template_tree-0.1.1-py2.py3-none-any.whl (7.7 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size django_template_tree-0.1.1.tar.gz (7.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page