Django accessibility in 2023 and beyond

Happy birthday, Django accessibility team! šŸŒˆ

The team has been up and running for three years, and is now looking for new members. With a lot happening in this space, we thought we were overdue for an update on what weā€™re up to.

Django accessibility in 2023

Weā€™re very happy with the work done to date. There have been a lot of efforts to improve the accessibility of core Django features such as forms, and of the administrative interface. Beyond Django core, there has also been progress on djangoproject.com, Django packages, and community awareness via talks and events.

Django core

We made a lot of improvements this year. Django forms saw big fixes, which shipped in Django 5.0:

Fieldsā€™ help text and errors should be associated with input ā€“ #32819
Fieldsā€™ errors should be programmatically associated with fields ā€“ #32820

With forms being such a core feature of Django, reused across countless websites, those changes will lead to accessibility improvements across big parts of the web.

The admin interface also saw a lot of fixes and improvements:

Tab order should match visual order for admin model formsā€™ submit buttons – #33728
Low text contrast over light blue backgrounds in admin light theme – #34036
Ensures <meta name=”viewport”> does not disable text scaling and zooming – #34617
Admin action log entry types should be communicated to screen reader users – #34618
Django admin site name shouldnā€™t be an h1 – #34621
RelatedFieldWidgetWrapper links donā€™t convey their state for screen reader users – #34622
Active row states invisible for WHCM users – #34627
RelatedFieldWidgetWrapper link icons are very hard to see – #34628
Use banner landmark or <header> element for the admin header area – #34832
Use a main landmark in the admin interface – #34833
Use search role for the admin changelist search form – #34834
Use a nav element or navigation landmark for changelist filters – #34835
Date picker cancel button does not respect color theme/dark mode – #34857
Main landmark is on the wrong element – #34905
Accessible names for Add / Change buttons in Django Admin – #34909
Admindocs index skips from h1 to h3 – #34911
Admindocs back-links and bookmarklet help text is too small – #34912
Django Admin high contrast mode no clear session – #34913
Missing scope attribute in admin doc table headers – #34919

Some of those improvements will reflect for everyone, and some will only be beneficial for users of specific assistive technologies, such as Contrast themes in Windows:

ā†’ Screenshot of the admin interface in a ā€œChange redirectā€ form, in Windows high contrast mode with the ā€œBlackā€ theme.

Can you spot the five issues in this screenshot? Though Contrast Themes isnā€™t well known, itā€™s a built-in feature of Windows which is essential for people with low vision. There is a lot of room for improvement to better support it in Django.

Weā€™ve also made a lot of progress on documenting accessibility considerations, though there is still work to be done there:

FAQ: What assistive technologies are supported for using the admin?
In progress: Accessibility guidelines for all contributors
In progress: Guidelines for accessibility considerations in documentation

And finally tooling improvements such as running accessibility checks in the CI pipeline is still a big topic for us, with in-progress efforts to add checks in Selenium tests and standalone with Pa11y.

Django website

In 2023, the website saw its first ever accessibility audit with a focus on the homepage, as well as a good number of accessibility improvements. Those are all very welcome iterative steps in the context of user research on the usability of the website, led by 20tab.

Display all header anchor link indicators, always – #1429
Add Keyboard Accessibility To Hamburger Menu – #1418
Fix selection css on dark mode – #1415
Add back to top link in documentation – #1370
Improve accessibility on warning admonitions – #1360
Accessibility review of djangoproject.com at DjangoCon Europe 2023

Thank you to our website contributors Sarah Abderemane, Thibaud Colas, ontowhee, Sanyam Khurana, Hana Burtin, Paolo Melchiorre, and Tom Carrick ā¤ļø.

Accessibility in our community

Weā€™re elated to see accessibility being such a prominent topic in our community. In 2023, there were a lot of accessibility talks at Django events. There were accessibility contributors at the sprints for DjangoCon Europe, and DjangoCon US. The #accessibility channel on the Django Discord was also very active, and we got a new Accessibility forum category.

There were a lot of accessibility-focused talks at Django events:

Django Accessibility for Everyone ā€“ DjangoCon Europe 2023, by Lauren Parsons
Consider the Colourblind ā€“ Django Day CPH 2023, by Michael Nicholson
Best Practices for Making a Wagtail Site as Accessible as Possible ā€“ DjangoCon US 2023, by Scott Cranfill
Djangoā€™s accessibility track record ā€“ DjangoCon US 2023, by Thibaud Colas
Making Our Python Code More Accessible ā€“ PyOhio 2023, Dmitriy Chukhin & Janelle Bouchard

Our very own accessibility team member Sarah Abderemane was also featured on Django Chat: Accessibility – Sarah Abderemane šŸŽ‰, while Tom and Thibaud signed up for Djangonaut Spaceā€™s first session as navigators.

Behind the scenes, the accessibility team also started maintaining a backlog of django accessibility improvement, and also publish their accessibility team meeting notes on the forum.

Django accessibility in numbers

This year, we were able to produce statistics on the accessibility of Django projects, thanks to reports from the HTTP Archive. There is clear room for improvement, with Django websites generally scoring lower than sites built with other technologies:

ā†’ Median Lighthouse website accessibility score of websites by framework. Source: HTTP Archive cwvtech.report, December 2023. Next.js: 85/100, Rails: 83, ā€œAllā€: 82.5, Django: 80.5, ASP.NET: 79, Laravel: 78.5.

There is also clear data to establish exactly which accessibility issues are common on Django websites:

ā†’ Difference in Lighthouse audit success rate for sites built with Django vs. average site, HTTP Archive 2023-04-01 data, Django vs. ā€œAllā€. We see 8 metrics where Django does worse than average, and 8 where it does better.

We see those numbers as a good challenge for the Django community to explore ways in which the framework could be improved. There is clear room for improvement, and we have a lot of ideas on how to go about it.

Accessibility plans for 2024

There are a lot of ways in which the accessibility of Django could be improved in 2024. Here are a few ideas that have been discussed so far, where our accessibility team is looking for help:

Django ecosystem accessibility audits: Testing Trac or the Forum; or popular Django packages.
Creating an official Django demo site: converting Tomā€™s django-admin-demo to a ready-to-use official demo.
Stylesheets linting: To catch and fix common issues such as small font sizes or poor focus states.
Accessibility in docs: A possible big docs overhaul as a Google Season of Docs project.
New, accessible admin components: Addressing big gaps in the admin interface.
User testing: Working directly with users of assistive technologies.
An official Django accessibility statement: On the website, loud and clear.

New members

With this roadmap of improvements in mind, our accessibility team is looking for six new members in 2024. If this sounds like the type of valuable, high-purpose work you want to contribute to ā€“ reach out on the Django Discord in #accessibility, or on the forum.

Thank you

Thank you to everyone who took part in making Django more accessible in 2023 and early 2024. You rock!


You?

Come say hi on the forum