from django.template import Library register = Library() @register.filter def get_range( value ): """ Filter - returns a list containing range made from given value Usage (in template): Results with the HTML: Instead of 3 one may use the variable set in the views """ return range( value )