Opened 27 hours ago
Last modified 8 hours ago
#36851 assigned New feature
Add dark mode support for Django debug error pages
| Reported by: | Ekin Ertaç | Owned by: | Ekin Ertaç |
|---|---|---|---|
| Component: | Error reporting | Version: | 6.0 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | yes |
Description
Problem
When working in dark mode environments, Django's debug error pages (500, 404, etc.) display with bright white backgrounds (#fff and #eee), which causes significant eye strain and discomfort. This is a common issue for developers who work in dark mode, as the sudden bright white page can be jarring and painful to look at.
Django's admin interface and the main Django website already support dark mode, but the error pages do not, creating an inconsistent experience.
Proposed Solution
Add dark mode support to Django's debug error page templates using CSS media queries (@media (prefers-color-scheme: dark)). This would automatically detect the user's system preference and apply appropriate dark theme colors.
The affected templates are:
django/views/templates/technical_500.htmldjango/views/templates/technical_404.html
This should follow the same pattern used in Django admin for consistency.
Benefits
- Reduces eye strain for developers working in dark mode
- Creates consistency with Django admin and website dark mode support
- Respects user's system preferences automatically
- No breaking changes - light mode remains the default for systems without dark mode preference
Change History (7)
comment:1 by , 26 hours ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:3 by , 26 hours ago
| Owner: | removed |
|---|---|
| Status: | assigned → new |
comment:4 by , 26 hours ago
i am sorry i have deassigned myself , i should have read the description properly , i though the proposed solution was for someone else to implemement , i am really sorry again
comment:5 by , 26 hours ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:6 by , 26 hours ago
Hi @Kundan Yadav,
No worries at all. I understand the confusion. I've now claimed the ticket and will continue working on it. The implementation is complete with tests, and the PR is ready for review.
Thanks for your consideration, and I appreciate your message.
comment:7 by , 8 hours ago
| Has patch: | set |
|---|
Hi @Kundan Yadav,
I've implemented dark mode support for Django's debug error pages as described in this ticket. The implementation includes:
Changes:
@media (prefers-color-scheme: dark)CSS to bothtechnical_500.htmlandtechnical_404.htmlTesting:
Pull Request:
Pull request created: https://github.com/django/django/pull/20506
The branch is ready for review. Let me know if you need any adjustments!