def validate_template_syntax(source):
    try:
        Template(source)
    except (TemplateSyntaxError, TemplateDoesNotExist) as err:
        raise ValidationError(text_type(err))
Basic Django Template syntax validation. This allows for robuster template
dataset/ETHPy150Open ui/django-post_office/post_office/validators.py/validate_template_syntax