Django: Sanitize incoming HTML fragments with nh3
How to use the nh3 package to sanitize HTML fragments in Django forms and models to prevent cross-site scripting attacks, customizing the allowed tags and attributes based on what a site's rich text editor supports.