[Answer]-When variables not allowed to be null are actually created with no data on Django


First, Avoid using null on string-based fields such as CharField and TextField unless you have an excellent reason (https://docs.djangoproject.com/en/dev/ref/models/fields/#null)

The following schema would be generated for your fields in DB

event character varying(200),
tool character varying(200),
other character varying(200) NOT NULL,
protocol character varying(200) NOT NULL,

This would mean that you can enter “NULL” values in database for ‘event’ and ‘tool’ field but not for ‘other’ and ‘protocol’ fields.

Yet, you can enter a blank text for all the fields irrespective of weather they are “blank=True” or not. Reason being that “Blank=True” is only used by Django for its own validations and its not reflected in Database schema.


Leave a comment