How to remove specific string from django template ?

SO i have the following string in the a href tag.

<a href="{{item.slug}}"></a>

this gives me the following

I tried the following but does not work. (It does not remove the keyword category)

<a href="{{item.slug | cut: 'category'}}"></a>

Please Help

I’m actually a little surprised that this isn’t throwing an error.

The syntax for filters is very exact. Note that you cannot have a space between the “cut:” and the parameter.

See The Django template language | Django documentation | Django and Templates | Django documentation | Django