Accessibility wins�for Django projects
1
Thibaud Colas, he/him, @Torchbox��Slides: thib.me/django-wins
A Wagtail story
2
Slides: thib.me/django-wins
3
Why do we care about making Wagtail accessible
�We want to provide an inclusive experience.
We want people relying on assistive technology to be successful in the workplace.�
Accessibility improvements lead to usability improvements.
4
Search: “Curb cut effect”
Other reasons to make Wagtail accessible
�For users of assistive technology, Wagtail’s admin interface is difficult to use.��When choosing a CMS, this might make Wagtail a bad option – because of legislation that mandates compliance with accessibility standards.�
US: Section 508 for public sector, ADA for all
EU: 2016 Accessibility Directive, 2019 European Accessibility Act
5
Oh, and it’s not just Wagtail
Intranets, CRMs, ERPs, dashboards. Django admin.
Internal tools shouldn’t compromise on accessibility just because their audience is smaller.
6
EU legislation overview
23/09/2020: all public sector must comply with 2016 directive
23/06/2021: all public sector mobile apps
2025: e-commerce, banking, transport services – must comply with 2019 act
All based on WCAG 2.1, AA level
7
8
Credit: Yomex Owo @ Unsplash
Common* issues
* Very common. Go check your sites after the talk
9
10
Alt text for images
11
Alt text for images
12
Alt text for images
Solution: “alt text” field wherever a non-decorative image is used in your models
13
No-nonsense alt text guide: axesslab.com/alt-texts
Alt text for images
14
Videos
15
Videos
16
Videos
Or…
17
Videos
18
Heading levels
Screen reader users rely on logical, lean heading outlines to navigate pages
19
Heading levels in Wagtail
body = RichTextField(features=['h2', 'h3', 'bold', 'italic', 'link'])
20
Heading levels troubleshooting
21
Bookmarklet: h123
Forms
Avoid as_table or as_ul
Vanilla HTML from Django is missing a lot of basic usability cues – indicating required fields, showing expected patterns for date/time fields, etc.
22
23
Developer wins
24
25
Training
26
Tooling
Axe – Accessibility rules engine with support for WCAG & Section 508
Accessibility Insights – Browser extension with Axe and more
Pa11y – Command line tool for accessibility checks with Axe & HTML_CS
eslint-plugin-jsx-a11y, eslint-plugin-vue-a11y, stylelint-a11y
27
Pa11y example: github.com / thibaudcolas / django_admin_tests
Based on the official v.Nu validator. Very easy to integrate into your workflow with Docker.
No “p” element in scope but a “p” end tag seen.
End tag “div” seen, but there were open elements.
Unclosed element “section”.
Consider using the “h1” element as a top-level heading only.
28
pip install django-pattern-library
35
Learn how to use a screen reader
On a Mac with VoiceOver,
That’s it.
Even simpler on iOS. Equally as simple (but different) on Windows with NVDA.
36
Community wins
37
A cultural shift?
38
Django developers have a role to play
It matters on all projects, all audiences
There are well-defined standards, and readily available tools.
39
Django as a framework has a role to play
The WebAIM Million keeps track of the accessibility of 1M websites’ homepages
In 2020, there is no reason for a site to launch with accessibility issues that can be found in two clicks with automated tools.
40
41
An accessible future for Django?
What do you think?
42
43
Thank you!
Let’s work on this together some time?
44
Image credits: Firefox Emoji, Django pixel heart
Thank you to William Blackie for his help reviewing this talk��Slides: thib.me/django-wins
Questions
Django DEP: https://github.com/django/deps/pull/69
Accessibility beyond screen readers:
45