peopledoc/django-templates-forest

Name: django-templates-forest

Owner: PeopleDoc

Description: Django commands to help you inspect your templates' structure

Created: 2018-02-06 10:08:57.0

Updated: 2018-02-06 11:48:32.0

Pushed: 2018-02-06 15:20:59.0

Homepage: null

Size: 62

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Django Templates Forest (BETA)

Templates Forest is just a series of django commands that might help you visualize your templates' inheritance and will give you some detailed information about them so you could clean your template's structure

Install
  1. Add templates-forest to your requirements (and install it, via pip or something)
  2. Add templates_forest to your INSTALLED_APPS
  3. Add APPLICATION_DIR to your settings. This is the path to your app

How to use

There are currently three django commands and they all have the same common parameters.

Common parameters
templates_trees

Displays a list of trees found. For each tree we display the top template to select which tree to display.

Next to each tree root we have the height of the three (the number of edges on the longest downward path between the root and a leaf)

Templates_trees command example

template_info <template path>

Displays the information for a single template: His position inside a tree, all the templates included inside this template, and the list of templates that include this template:

template_info command example

templates_check

Using the template trees it will display a list of templates that we only included once (“useless include”) and the orphan templates that were never included and that can't be found on the python files in APPLICATION_DIR

templates_check command example


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.