--- id: django-coverage-plugin version: "3.2.2" license: Apache-2.0 license_treatment: permissive maintenance: active --- # django-coverage-plugin — Django template coverage.py plugin License: permissive · Maintenance: active · Downloads: 1.1M/mo ## What it is and what it does django-coverage-plugin extends coverage.py to track which lines of your Django HTML templates are executed during testing. Rather than treating templates as unmeasured code, it hooks into Django's template debugging system to record which template lines ran, which didn't, and which were conditionally skipped. You configure it by adding a single line to your .coveragerc file, then run your tests normally under coverage.py—templates appear in your coverage report just like Python modules. The plugin requires Django templates to have debugging enabled (TEMPLATES.OPTIONS.debug = True) and works with Django 5.2 through 6.0 on Python 3.10 through 3.14. It can also discover unused template files in your templates directory and include them in results. Configuration supports filtering by file extension and respects standard coverage.py settings like source, include, and omit. Use it for: - Measure test coverage of Django template rendering to identify untested template branches and conditional blocks - Discover unused template files in your project that can be safely removed - Enforce minimum coverage thresholds for templates as part of CI/CD pipelines - Debug template execution paths by seeing which lines ran during specific test cases - Generate unified coverage reports combining Python and template coverage metrics ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A coverage.py plugin that measures test coverage of Django templates, integrating template execution tracking into your coverage reports alongside Python code coverage. Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real gap in Django testing—template coverage is otherwise invisible to standard coverage.py. Install it if you use Django templates and want to measure test coverage comprehensively. The only gotcha is the requirement to enable template debugging in settings, which is documented clearly. ## Install pip install django-coverage-plugin uv add django-coverage-plugin poetry add django-coverage-plugin ## Installing django-coverage-plugin Before you install: Low install friction with a wheel distribution. Actively maintained as of 2026-04-04, with recent fixes for template line reporting and support for Django 5.2 and 6.0. Requires only coverage and Django as runtime dependencies. License in practice: Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution. Quickstart: pip install django-coverage-plugin # Add to .coveragerc: # [run] # plugins = django_coverage_plugin # Then run: coverage run --source='.' manage.py test coverage report DJANGO_SETTINGS_MODULE environment variable must be set, and TEMPLATES.OPTIONS.debug must be True in your Django settings for template coverage to work. Verify before relying: - Whether template coverage accuracy varies significantly across different Django template tag libraries or custom tags - Performance impact on large projects with hundreds or thousands of templates ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags django template coverage measurement, coverage.py django plugin, template test coverage reporting, django template debugging coverage, coverage integration django templates, django-testing, coverage-measurement [View on SkillFed](https://skillfed.io/packages/django-coverage-plugin) · [View on PyPI](https://pypi.org/project/django-coverage-plugin/)