
import re

file_path = r'accounts/templates/accounts/register_abroad.html'

with open(file_path, 'r', encoding='utf-8') as f:
    lines = f.readlines()

print(f"Checking {len(lines)} lines...")
bad_count = 0
for i, line in enumerate(lines):
    # Check for {{ opening but no }} narrowing on same line
    # (Simplified check)
    if '{{' in line and '}}' not in line:
        print(f"Line {i+1}: {line.strip()}")
        bad_count += 1
    
    # Also check slightly more complex cases like {{ form.username.errors }} but spaced oddly?
    # No, user confirms raw code like '{{ form.username.errors }}' which usually means newlines.
    
    # Check specifically for username
    if 'username' in line and 'errors' in line:
         print(f"Username Line {i+1}: {line.strip()}")

print(f"Found {bad_count} bad lines.")
