[Django]-Urlencode filter is not working in django templates

5👍

The urlencode filter only encodes characters that are unsafe to have in a URL. If you want to encode all characters then you will need to write or find a different filter for that.

5👍

As per the django documentation – / is not escaped in default case.
To escape / or other characters as well, use the optional parameter as

{{ value|urlencode:"" }}

more details – https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#std:templatefilter-urlencode

Leave a comment