Skip to main content

Generate diagrams showing relationships between templates in Django projects

Project description

https://badge.fury.io/py/django-template-tree.svg https://travis-ci.org/paul-butcher/django_template_tree.svg?branch=master https://codecov.io/gh/paul-butcher/django_template_tree/branch/master/graph/badge.svg

Generate diagrams showing relationships between templates in Django projects

Documentation

The full documentation is at https://django_template_tree.readthedocs.io.

Quickstart

Install django-template_tree:

pip install django_template_tree

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'template_tree',
    ...
)

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')),
    ]

Features

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

_static/screenshot.png

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

_static/screenshot-collapsed.png

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

http://localhost:8000/__tt__/?exclude_app=template_tree&exclude_app=admin

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

Credits

Tools used in rendering this package:

History

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.

Source Distribution

django_template_tree-0.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

django_template_tree-0.1.1-py2.py3-none-any.whl (7.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django_template_tree-0.1.1.tar.gz.

File metadata

File hashes

Hashes for django_template_tree-0.1.1.tar.gz
Algorithm Hash digest
SHA256 df977b20dc86194fdfade84e38e196ded73579d246e0abde0e9cb7ecf40b3262
MD5 e267f0ff24256ee1a32bb016eaf26372
BLAKE2b-256 3713bbe70a479ada2e6cd454fc75d3e1e11d89cfe0edb91e2165bdf4fd22c59a

See more details on using hashes here.

File details

Details for the file django_template_tree-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_template_tree-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6e049d1f29398935bd01484a835e9533d7c7cacb1a4d14edfaf9f11a1ed93128
MD5 8b943fd65dee933d678a730fe4a923b5
BLAKE2b-256 a992fc707f1c77668b546c42e77f2779a9b0bba06563f04e8ac18626c6b8d69d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page