Skip to content
AMeng edited this page Sep 14, 2010 · 4 revisions

Django Unused Templates checks your Django project for unused templates.

To use, navigate to your desired directory (could be your top level) and run the script through python:

python django-unused-templates.py

It gathers the file names of all .html files that sit in a /templates/ directory, and subdirectories. It then checks all .py files and .html files for an instance of this name. This covers all possible uses of the template file. If the template file is not referenced in any of the other files in your project, it is considered “unused.” The script will display a list of all unused templates.

Clone this wiki locally