먼저 장고 model을 설정 할 떄 필드의 옵션에 들어가는 default와 blank, null이 각각 무엇을 의미하는지 궁금해졌다.
해당 내용에 대해서 찾아보았다.
The blank optionis used in the form validation, and the null is used when writing to database.
So you might add null=Trueto that field.
EDIT:continue the comment
Considering the two steps when saving object:
1. Validator(controlled by blank)
2. Database limitation(controlled by null)
Fordefaultoption, take IntegerField for example,
default=5, blank=True, null=False, pass (1) even if you didn't assign a value(having blank=True), pass (2) because it has a default value(5) and writes 5 instead of None to DB.
blank=True, null=False, which pass (1) but not (2), because it attempts to write None to DB.
Thus, if you want to make a field optional, use either default=SOMETHING, blank=True, null=Falseor blank=True, null=True.