scan_templates
Scan all Django templates for N+1 query risks, resolving template contexts automatically from class-based views to analyze entire projects without manual setup.
Instructions
Run the N+1 analysis over every template in a directory.
find_n_plus_one needs a context map per template. This resolves it instead
from class-based views that declare template_name together with model or
queryset, so a whole project can be scanned without typing anything.
Args:
template_root: template directory. Defaults to the project path.
project_root: where to look for views. Defaults to the project path.
root_models: context applied to every template, for names no view supplies.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root_models | No | ||
| project_root | No | ||
| template_root | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||