How can I turn off Django\'s automatic HTML escaping, when I write into model\'s TextField?
One way to do it is to put a function in your model which returns the data marked as safe:
from django.utils.safestring import mark_safe
class MyModel(models.Model):
my_textfield = models.TextField()
def display_my_safefield(self):
return mark_safe(self.my_textfield)
Then in the template you would have to use:
{{ instance.display_my_safefield }}