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 }}
def check(collection):
if len(set(collection)) == len(collection):
return True
return False