What is the difference between null=True and blank=True in Django?

When we add a database field in django we generally write:

models.CharField(max_length=100, null=True, blank=True)

The same is done with ForeignKey, DecimalField etc. What is the basic difference in having

  1. null=True only
  2. blank=True only
  3. null=True, blank=True

in respect to different (CharField, ForeignKey, ManyToManyField, DateTimeField) fields. What are the advantages/disadvantages of using 1/2/3?

2
24

Leave a Comment