Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

decode in django templates

register = template.Library()

@register.filter
def convert_byte_to_string(value):
    return value.decode("utf-8") if value else value

Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #decode #django #templates
ADD COMMENT
Topic
Name
4+4 =