In my Django project i hae to split a string into a template based on a specific char.
str1 = "Part1 - Part2"
in pure python I would do it like this:
part1 = str1.split("-",1)[0]
part2 = str1.split("-",1)[1]
using django template instead i try:
{{ str1|split:'-'|first }}
but i give an error:
Invalid filter: 'split'
Someone can help me for split my variable ina django template and take just the first or second part based on a specific char?
So many thanks in advance