diff options
| author | Marijke Luttekes <mail@marijkeluttekes.dev> | 2024-01-28 13:51:34 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-01-31 12:26:00 +0100 |
| commit | b9e2a3fc63e68d248d528c73736275ca2746872d (patch) | |
| tree | 4967724fd8bc1618358f7abfc4e72ddb81f9d791 /django/views/templates/technical_404.html | |
| parent | c317e81378a15379cba4abc289d9519ee0335a80 (diff) | |
Fixed #35143 -- Improved accessibility of 404/500 debug pages.
This:
- changes the header, main, and footer content areas to be rendered
in a <header>, <main>, and <footer> tags,
- adds scope attributes to <th>,
- uses <code> for a patterns list,
- uses <small> instead of <span>.
Diffstat (limited to 'django/views/templates/technical_404.html')
| -rw-r--r-- | django/views/templates/technical_404.html | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/django/views/templates/technical_404.html b/django/views/templates/technical_404.html index c47dae22af..f2bfe49372 100644 --- a/django/views/templates/technical_404.html +++ b/django/views/templates/technical_404.html @@ -9,9 +9,9 @@ body * { padding:10px 20px; } body * * { padding:0; } body { font:small sans-serif; background:#eee; color:#000; } - body>div { border-bottom:1px solid #ddd; } + body > :where(header, main, footer) { border-bottom:1px solid #ddd; } h1 { font-weight:normal; margin-bottom:.4em; } - h1 span { font-size:60%; color:#666; font-weight:normal; } + h1 small { font-size:60%; color:#666; font-weight:normal; } table { border:none; border-collapse: collapse; width:100%; } td, th { vertical-align:top; padding:2px 3px; } th { width:12em; text-align:right; color:#666; padding-right:.5em; } @@ -24,27 +24,28 @@ </style> </head> <body> - <div id="summary"> - <h1>Page not found <span>(404)</span></h1> + <header id="summary"> + <h1>Page not found <small>(404)</small></h1> {% if reason and resolved %}<pre class="exception_value">{{ reason }}</pre>{% endif %} <table class="meta"> <tr> - <th>Request Method:</th> + <th scope="row">Request Method:</th> <td>{{ request.META.REQUEST_METHOD }}</td> </tr> <tr> - <th>Request URL:</th> + <th scope="row">Request URL:</th> <td>{{ request.build_absolute_uri }}</td> </tr> {% if raising_view_name %} <tr> - <th>Raised by:</th> + <th scope="row">Raised by:</th> <td>{{ raising_view_name }}</td> </tr> {% endif %} </table> - </div> - <div id="info"> + </header> + + <main id="info"> {% if urlpatterns %} <p> Using the URLconf defined in <code>{{ urlconf }}</code>, @@ -54,8 +55,10 @@ {% for pattern in urlpatterns %} <li> {% for pat in pattern %} + <code> {{ pat.pattern }} {% if forloop.last and pat.name %}[name='{{ pat.name }}']{% endif %} + </code> {% endfor %} </li> {% endfor %} @@ -69,14 +72,14 @@ {% if resolved %}matched the last one.{% else %}didn’t match any of these.{% endif %} </p> {% endif %} - </div> + </main> - <div id="explanation"> + <footer id="explanation"> <p> You’re seeing this error because you have <code>DEBUG = True</code> in your Django settings file. Change that to <code>False</code>, and Django will display a standard 404 page. </p> - </div> + </footer> </body> </html> |
