Adam Starrh
Adam Starrh

Reputation: 6958

Django: Not null constraint even though null=True?

I'm getting this when I submit my Model form:

null value in column "bio_1" violates not-null constraint

event though the value is set correctly in my models:

bio_1 = models.CharField(max_length=1024, blank=True, null=True)

I've run my migrations, and the field is not included anywhere in the form's view.

What else could be causing this error?

Upvotes: 0

Views: 765

Answers (1)

Robert Moskal
Robert Moskal

Reputation: 22553

Did you look in the database to see whether the constraint exists?

Maybe you didn't really run the migrations.

Upvotes: 2

Related Questions