Django template convert to string
You can use {{ value|slugify }}
(https://docs.djangoproject.com/en/1.10/ref/templates/builtins/).
You can use stringformat
to convert a variable to a string:
{{ value|stringformat:"i" }}
See documentation for formatting options (the leading %
should not be included).