code: def validate_template_syntax(source):
      
      try:
          Template(source)
      except (TemplateSyntaxError, TemplateDoesNotExist) as err:
          raise ValidationError(text_type(err))
docs: Basic Django Template syntax validation. This allows for robuster template
      authoring.