null:
If True, Django will store empty values as NULL in the database. Default
is False.
如果为True,空值将会被存储为NULL,默认为False。
blank:
If True, the field is allowed to be blank. Default is False.
如果为True,字段允许为空,默认不允许。
其实这种问题 去django官网一搜索就搜索出来了
null是和数据库相关的,blank是和页面表单验证相关的。
null = True 表示空值将会被存储为NULL
blank = True 表示在页面当中对应的表单可以为空,可以不填任何内容
官网关于该知识的链接:
https://docs.djangoproject.com/en/dev/ref/models/fields/#null