@register.filter()<EOL>def str2tokens(string, delimiter):
token_list = [token.strip() for token in string.split(delimiter)]<EOL>return token_list<EOL>
Usage:
{% with 'this, is a, string'|str2tokens:',' as token_list %}do something{% endwith %}