Skip to content

Exclude django-debug-toolbar from the Pa11y CI scan (#1278)#1342

Merged
jonfroehlich merged 1 commit into
masterfrom
1278-a11y-exclude-debug-toolbar
Jun 18, 2026
Merged

Exclude django-debug-toolbar from the Pa11y CI scan (#1278)#1342
jonfroehlich merged 1 commit into
masterfrom
1278-a11y-exclude-debug-toolbar

Conversation

@jonfroehlich

Copy link
Copy Markdown
Member

What & why

Follow-up to the Pa11y CI job (#1278 item 6, merged in #1340).

The a11y job runs runserver with DEBUG=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 in debug_toolbar/templates/debug_toolbar/base.html) to hideElements — 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

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>
@jonfroehlich jonfroehlich merged commit 69e28e9 into master Jun 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant