Django-html_sanitizer.

Àº Django ¸ðµ¨, ¾ç½Ä ¹× ÅÛÇø´À»À§ÇÑ HTML Ŭ¸®´× À¯Æ¿¸®Æ¼ ¼¼Æ®¸¦ Á¦°øÇÕ´Ï´Ù.
Áö±Ý ´Ù¿î·Îµå

Django-html_sanitizer. ¼øÀ§ ¹× ¿ä¾à

±¤°í

  • Rating:
  • ƯÇã:
  • MIT/X Consortium Lic...
  • °¡°Ý:
  • FREE
  • °Ô½ÃÀÚ À̸§:
  • Selwin Ong
  • °Ô½ÃÀÚ À¥»çÀÌÆ®:
  • https://github.com/ui/

Django-html_sanitizer. ű×


Django-html_sanitizer. ¼³¸í

Django-HTML_Sanitizer´Â Django¿¡¼­ HTML ÀÔ·ÂÀ» ½±°Ô »ì±Õ / Å»Ãâ / ±ú²ýÇÏ°ÔÇÏ´Â À¯Æ¿¸®Æ¼¸¦ Á¦°øÇÏ´Â Django ÀÀ¿ë ÇÁ·Î±×·¥ÀÔ´Ï´Ù. ÀÌ ¾ÛÀº Ç¥¹éÁ¦ À§¿¡ ±¸ÃàµÇ¾î ÀÖÀ¸¸ç eLlected_apps : installed_apps = (# ±âŸ ¾Û "Sanitizer",) ¸ðµ¨ USageSimilar¿¡¼­ Bleach, Django Sanitizer´Â È­ÀÌÆ®¸®½ºÆ®ÀÔ´Ï´Ù (ÁöÁ¤µÈ ÅÂ±× ¹× ¼Ó¼º ¸¸ Çã¿ë) ±â¹Ý HTML ¼Òµ¶Á¦. Django Sanitizer´Â ÅؽºÆ® °ªÀ» ÀÚµ¿À¸·Î À§»ýÇÏ´Â µÎ °¡Áö ¸ðµ¨ Çʵ带 Á¦°øÇÕ´Ï´Ù. SanitizedCharfield ¹× SanitizedTextField. - allowed_tags : Çã¿ë µÈ HTML ÅÂ±× ¸ñ·Ï - Çã¿ë µÈ HTML ÅÂ±× ¸ñ·Ï - Çã¿ë µÈ HTML Ư¼º ¸ñ·Ï - ½ºÆ®¸³ : À§¹Ý ÅÂ±× / ¼Ó¼ºÀ» À̽ºÄÉÀÌÇÁ ¶Ç´Â ½ºÆ®¸®ÇÎ ÇؾßÇÏ´ÂÁö ¿©ºÎ¸¦ ³ªÅ¸³»´Â ºÎ¿ïÀÔ´Ï´Ù. »ç¿ë ¹æ¹ý Django ¸ðµ¨¿¡¼­ : Django.db °¡Á® ¿À±â ¸ðµ¨ From Sanitizer.Models Import Sanitizer CharField, SanitizedTextFieldClass MyModel (Models.Model) : # ,

, ÅÂ±× ¹× "href"¹× "src"¼Ó¼º ¸¸ Çã¿ë = SanitizedCharField (max_length = 255, allowed_tags = , allowed_attributes = , strip = false) bar = sanitizedtextfield (max_length = 255, allowed_tags = , allowed_attributes = SanitizedCharField, SanitizedTextFieldClass MyForm (Forms.Form) °¡Á® ¿À±â : # ,

, ÅÂ±× ¹× "HRE ¸¸ Çã¿ë f "¹×"src "¼Ó¼º foo = sanitizedCharfield (max_length = 255, allowed_tags = , allowed_attributes = : - eachine_html ÅÛÇø´ TageXample »ç¿ë : {% Load Sanitizer %} {% kocess_html post.content "a, p, img" "href, src"%}Àº ' ¿¹Á¦ ¹®ÀÚ¿­À» °¡Á¤ÇÕ´Ï´Ù.

°ü·Ã ¼ÒÇÁÆ®¿þ¾î