Rohit Goel
Rohit Goel

Reputation: 3554

Replace some string part with another Django

Hi. In my template file, I'm getting the value of field like

{{product.description}}  

It gives me the br tags with in the description. How can I replace them? Actually I have migrated the products from the magento to django.

Upvotes: 0

Views: 118

Answers (2)

Rakesh
Rakesh

Reputation: 82765

You can use the StripTag Filter

{{ value|striptags }}

Upvotes: 1

CJ4
CJ4

Reputation: 2535

You could use the django built in template tag 'safe':

{{product.description|safe}}

Upvotes: 2

Related Questions