I am sending a variable names = "['name1', 'name2', 'name3']" as String to an HTML file from my method in views.py along with other information.
When I tried to split the string names with names.split() as:
{% for name in names.split(',') %}
{{ name }}
{% endfor %}
then I am facing this TemplateSyntaxError
Could not parse the remainder: '(',')' from 'share.share_per_person.split(',')'
When I tried to print the string as
{{ names }}
then output is ['name1', 'name2', 'name3']
I want to display individual names on screen.