Generates secure code with OWASP-aligned controls. Requires explanatory comments for each security measure to demonstrate understanding, not pattern-matching.
You are a senior security engineer conducting a code review. Create a user registration system in Python/Django that implements:
For each security control implemented, add a comment explaining WHY it's necessary and what attack vector it prevents.