Django-CKeditor: How to show RichTextFields in templates

Viewed 4725

The problem is that I want to show the content of a Post in the template but I don't know how

The model of Post is:

from ckeditor.fields import RichTextField

class Post(models.Model):

    ...
    content = RichTextField(verbose_name='contenido')
    ...

And in the template I have a for to show all the post that is like this:

{% for post in posts %}
    ...
    {{ post.content }}
    ...
{% endfor %}

But when I see the page in the browser shows this: < p > Post content < /p >

Instead of this: Post content

2 Answers
{{article.body|safe}}

or

{{article.body|truncatechars:150|safe}}

or

{{article.body|truncatewords:25|safe}}
Related