PyGRAZ ist eine Usergroup mit die Python-Programmiersprache in Graz. Wir treffen uns regelmässig am ersten Dienstag im Monat entweder im realraum oder im Gösserbräu.

Session: Django HTML and XML Validator

von Thomas Aglassinger

Diese Session wurde am 1. November 2022 gehalten.


Django provides templates to render HTML pages. These are essentially HTML files mixed with additional programmable markup. Because of this extension, they are generally not valid HTML, and consequently cannot be validated uses common tools like tidy.

Middleware solutions exist to validate the HTML actually rendered from the template. However, most of them either send your HTML to external sites for validation or require the installation of external tools.

The middleware presented in this talk uses lxml to quickly and localy validate HTML generated from Django templates.

Comments powered by Disqus