django-sanitizer

Django template filter application for sanitizing user submitted HTML
Download

django-sanitizer Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Other/Proprietary Li...
  • Price:
  • FREE
  • Publisher Name:
  • Calvin Spealman
  • Publisher web site:
  • https://github.com/ironfroggy/

django-sanitizer Tags


django-sanitizer Description

django-sanitizer is a Django app that allows only whitelisted tags and attributes through.The setting ALLOWED_TAGS can override the behavior. The syntax of this setting is a space-separated list of tags, which are optionally followed by a colon and a comma-separated list of attribute permitted in the tag.For example, to allow < a > tags which are links or named anchors, but not to allow definition of an onclick attribute: ALLOWED_TAGS = "a:href,name"In your templates, sanitizing is easy. {% load sanitizer %} {{ user_comment|allowtags|safe }} {{ user_comment|allowtags:"b i"|safe }}Disallowed tags or attributes are simply removed.Product's homepage


django-sanitizer Related Software