G
G
gromyko212020-10-28 13:02:08
Django
gromyko21, 2020-10-28 13:02:08

How to get rid of shielding?

Good afternoon, I ran into a problem with escaping (adds html tags, scripts when submitting them from a form). I honestly googled, but basically it is advised to add a safe filter or

{% autoescape off %}
    {{ message_form.content}}
  {% endautoescape %}

none of the above helps.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gromyko21, 2020-10-30
@gromyko21

Finally solved with https://github.com/ui/django-html_sanitizer . The work is clearly described here. Just on the back in the form I added message = SanitizedCharField(strip=False) before importing everything, respectively, and the problem went!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question