Retrieve the length of a value using Django templates and filters
If you want to output the length of a value in one of your Django templates, you can use length
, which is built in to the templating engine.
{{ value|length }}
Example:
Assume value of mylist
is ['one', 'two', 'three']
{{ mylist|length }}
will output 3