The Django db_default Gotcha That Breaks Your Code

Starting in Django 5.0, you can use db_default to define database-level default values for model fields. It&rsquo;s a great feature but comes with a subtle and dangerous gotcha that can silently break your code before the object is ever saved. The Gotcha in Action Let&rsquo;s say you&rsquo;re building a simple task manager, and you want to track whether a task is completed: from django.db import…