28
Its simple you will have to pass this in the slice filter then:
{{ mylist|slice:"3:8" }}
This filter takes care of all type of slicing you can perform on a list
e.g. All this would work:
{{ mylist|slice:"3:8" }}
{{ mylist|slice:":2" }}
{{ mylist|slice:"3:" }}
{{ mylist|slice:":" }}
- [Django]-Link in django admin to foreign key object
- [Django]-Django template: check for empty query set
- [Django]-ImproperlyConfigured at / Empty static prefix not permitted – Django
Source:stackexchange.com