Is there a way urldecodein a Django template file?
urldecode
Just opposite urlencode or escape
I want to convert app%20llctoapp llc
app%20llc
app llc
You can create a simple custom filter around urllib.unquote
For instance:
from django.template.defaultfilters import stringfilter from urllib import unquote @stringfilter def unquote_raw(value): return unquote(value)
and now you can get this in your django template file:
{{ raw|unquote_raw }}
you need to write something like this instead of the previous answer, otherwise you will get the maximum recursion depth
from urllib import unquote @register.filter def unquote_new(value): return unquote(value)
{{raw | unquote_new}}