Remove Last Character from a String in Django Template

To remove the last character from a string in a Django template, use the built-in slice function. Pass slice after the string using a | (pipe), followed by the number of characters to remove like this:

 

{{ 'words'|slice:':-1' }}
word
django