I know the title doesn't make any sense, but I just want to know how to insert an empty string or '' in a CharField made in Django? As far as I know by default, fields in Django are not nullable. Checking data in PGAdmin, I can see that most of the CharFields have '' as value. I wonder how is this possible? If I run
cur_p.execute("""
INSERT INTO "table"name" (address, school_address, sports ) VALUES ('', '', '')
I will get psycopg2.IntegrityError: null value in column "created" violates not-null constraint
Also I noticed that some fields have blank=True
in them. Doesn't it contradict if you have a not nullable field then you declared blank=True
?