dangling_references
Find URL names and template references that will fail at runtime. Scans Django projects to catch NoReverseMatch and TemplateDoesNotExist errors before users hit them.
Instructions
URL names and template names that nothing will resolve.
return redirect("order-detial")
return render(request, "shop/order_detial.html", context)
{% url 'shop:order-detial' order.pk %}
Each of these is resolved while serving a request and checked by nothing
before then. Rename a URL pattern or move a template and they keep
importing, keep passing every test that does not walk that branch, and
raise NoReverseMatch or TemplateDoesNotExist the first time a real person
opens the page - on the path nobody was watching.
Both sides use the project's own machinery: names come from every URLconf
in the project walked through each include(), so namespaces are real and a
second URLconf served by host is not mistaken for a missing one; templates
go through get_template(), so the project's loaders decide.
`by_name` groups the findings, because one missing name used in
thirty-five places is one problem.
Args:
search_path: directory to scan. Defaults to the configured project.
include_templates: also read `{% url %}`, `{% include %}` and
`{% extends %}` out of the templates.
include_tests: also scan test modules. Off by default: tests run under
their own settings, so a name missing from these ones may be
registered under theirs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search_path | No | ||
| include_tests | No | ||
| include_templates | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||