Exclude django-debug-toolbar from the Pa11y CI scan (#1278)#1342
Merged
Conversation
The a11y job runs with DEBUG=True (so runserver serves media/static), which injects django-debug-toolbar into every page. Its markup accounted for ~76% of the reported violations (126 unlabeled panel checkboxes + 42 contrast findings) — dev-only noise absent from production. Hide #djDebug (same mechanism already used for #js-toc) so the baseline reflects the real site. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Follow-up to the Pa11y CI job (#1278 item 6, merged in #1340).
The
a11yjob runsrunserverwithDEBUG=True(needed so it serves media/static while pa11y scans). That injects django-debug-toolbar into every page — and its markup was ~76% of the reported violations: 126 "form element needs a visible label" (the toolbar's panel checkboxes) + 42 color-contrast findings. None of that exists in production (DEBUG=False, no toolbar), so it made the baseline misleading.Fix: add
#djDebug(the toolbar's root container, confirmed indebug_toolbar/templates/debug_toolbar/base.html) tohideElements— the same pa11y mechanism already used for#js-toc.After this, the scan reports only real site violations (~54, across 4 types). Tracking issue for those to follow.
Scope
One-line config change. No app/schema change; report-only job stays report-only.
🤖 Generated with Claude Code