0

In my views:

post_image = '<div class="images slides"></div>'

console.log(document.body):

<body>
    "<div class="images slides"</div>"
</body>

What I want:

<body>
    <div class="images slides"</div>
</body>

1 Answer 1

1

To render the content as HTML, use the safe filter

<div>
    {{ post_image|safe }}
</div>

https://docs.djangoproject.com/en/3.0/ref/templates/builtins/#safe

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.