[Answer]-Can not apply inline styling in Django

1👍

You should turn autoescape off:

{% autoescape off %}
<li class="col-md-10">{{ post.body|linebreaks }} </li>
{% endautoescape %}

Or use the safe template filter and omit autoescape template tag:

<li class="col-md-10">{{ post.body|safe|linebreaks }} </li>

To safely embed user generated data into your html code use the format_html() function.

Leave a comment