Django doesn't enforce NOT NULL at the model/database level. device_serial is neither supposed to have blank '' nor null
class Device(models.Model):
device_serial = models.CharField(max_length=36, unique=True, null=False, blank=False)
....etc
The statement below works totally fine! I expect it to fail because device_serial is required. It shouldn't accept empty string ''
Device.objects.create(device_serial='')
How can I make a field required at the model / database level? What could I possibly be doing wrong here? I don't see where did I go wrong. I tried ''.strp() to convert empty string to None but it didn't work