Search code examples
djangodjango-formsdjango-templatesdjango-viewsfroala

Froala not working properly in django


I tried to integrate froala in Django as shown in here

It worked perfectly in forms but when the content rendered in DetailView it shows this. Is their any workaround.

Page as rendered by DetailView:

Image as rendered by DetailView

and in the froala image upload not working as shown in image:

Image with error


Solution

  • As your image shows raw HTML, you should use safe:

    {{ my_html|safe }}
    

    It will prevent Django to escape your data.

    Documentation here.