Is there a generic "form sanitizer" that I can use to ensure all html/scripting is stripped off the submitted form? form.clean() doesn’t seem to do any of that – html tags are all still in cleaned_data. Or actually doing this all manually (and override the clean() method for the form) is my only option?
Is there a generic "form sanitizer" that I can use to ensure all html/scripting
Share
Django comes with a template filter called striptags, which you can use in a template:
It uses the function
strip_tagswhich lives indjango.utils.html. You can utilize it also to clean your form data: