django.template.TemplateEncodingError - python examples

Here are the examples of the python api django.template.TemplateEncodingError taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

3 View Complete Implementation : test_utils.py
Copyright BSD 2-Clause "Simplified" License
Author : evrenesat
    def __init__(self, template_string, name='<Unknown Template>',
            libraries=[]):
        try:
            template_string = encoding.smart_unicode(template_string)
        except UnicodeDecodeError:
            raise template.TemplateEncodingError(
                    "template content must be unicode or UTF-8 string")
        origin = template.StringOrigin(template_string)
        self.nodelist = self.my_compile_string(template_string, origin,
                libraries)
        self.name = name

Ezoicreport this ad