[Answered ]-Integrity Error NOT NULL constraint failed even though I have set blank=True, null=True in my model

1👍

i was facing the same problem as you, i made a sign up form, and it was giving me the same error because the .save() method was getting executed before i fill in the fields, there was no data to save, because of that: the fields type was None. so i just implemented an if else statement to make sure that the .save() method won’t be executed if the type of the field isnNone,
here is a snippet:

if field == None:
    pass
else:
    form.save()

Leave a comment