O
O
Oleg Vedernikov2017-04-10 15:20:14
Django
Oleg Vedernikov, 2017-04-10 15:20:14

How to convert string to html tag in django?

models.py

class Brand(models.Model):
  icon = models.CharField(max_length=255)

The icon field contains the string '<i class="fa fa-line-chart" aria-hidden="true">>', which should be displayed as an html tag in the template. How without using the safe template filter, how to prepare in the view? Which method or set of methods to use?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question