[Django]-How to set NULL for IntegerField instead of setting 0?

39👍

Instead of using

age = models.IntegerField()

use

age = models.IntegerField(blank=True, null=True)

When we specify

blank=True, null=True

it will allow you to store null in that column

Leave a comment