On retreiving Tinymce html field data displays html tag

I am using tinymce for description field in custom html, but when i retrieve it through queryset and trying to display in the html page, it displays all tags with it. like in the below image

model.py
from django.db import models
from tinymce.models import HTMLField

class MyModel(models.Model):

content = HTMLField()

forms.py
from tinymce.widgets import TinyMCE

class TinyMCEWidget(TinyMCE):
def use_required_attribute(self, *args):
return False
description = forms.CharField(
widget=TinyMCEWidget(
attrs={‘required’: False, ‘cols’: 30, ‘rows’: 10}
)
)

Try {{ description|safe }} in template

1 Like