Django Model Field Default to Null
If you specify null=True on the model field then the value will be stored as NULL in the database if the user does not provide a value.
blank=True
allows you to input nothing (i.e""
,None
) and keep it empty.null=True
means the database row is allowed to beNULL
.default=None
sets the field toNone
if no other value is given.
Try default=None
. There is no NULL
in python.