django-html-validator is a Django project that can validate your generated HTML. It does so by sending the HTML to https://html5.validator.nu/ or you can start your own Java server locally with
vnu.jar from here. The output is that you can have validation errors printed to
stdout or you can have them put as
.txt files in a temporary directory. You can also include it in your test suite and make it so that tests fail if invalid HTML is generated during rendering in Django unit tests.
The project seems to have become a lot more popular than I thought it would. It started as a one-evening-hack and because there was interest I wrapped it up in a proper project with “docs” and set up CI for future contributions.
tox.ini etc. and the necessary compatibility fixes to make it work with but Django 1.8 up to Django 2.1. Pull request here.
Thank you all who contributed! I’ll try to make a better job noticing filed issues in the future.
- Quick dog-piling (aka stampeding herd) URL stresstest 10 August 2018
- Related by Keyword:
- django-html-validator 20 October 2014
- Difference between $.data(‘foo’) and $.attr(‘data-foo’) in jQuery 10 June 2012
- Going real simple on HTML5 audio 14 October 2011
- EmailInput HTML5 friendly for Django 02 August 2011
- A script tag’s type in HTML5 10 May 2011