1👍
✅
If you want to do this via your template not your views file, you could create your own filter based on slice e.g.
from django.template.defaultfilters import slice_filter
@register.filter("slice_default", is_safe=True)
def slice_filter_20(value, arg=":20"):
return slice_filter(value, arg)
Source:stackexchange.com