I have a model with this field:
my_field = models.CharField(max_length=100, default='')I have the default set to empty string but when I create an object with my_field="", it says "This field cannot be blank". Does default='' not imply that it can be blank? Do I have to explicitly set the blank=True?
1 Answer
Yes, you need to set blank=True.
my_field = models.CharField(max_length=100, default='', blank=True) 1