x = 'Text {{ data }} text'
{{ x }}
Text {{ data }} text
from django import template
register = template.Library()
@register.filter(name='string_replace')
def string_replace(string, value):
return string.replace('{{ data }}', value)
{% load string_replace %}
{{ x | string_replace:data }}