#!/usr/bin/env python """ Test template syntax without errors """ import os import sys import django os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') django.setup() from django.template import Template, Context # Test if the template syntax is valid try: # Minimal template to check syntax test_template = """ {% for field in form %} {% if "attribute_" in field.name %}