1👍
✅
Specifying null=True
[Django-doc] does not mean the field is not required. null=True
has only impact on the database: it makes the field NULLable. You should use blank=True
[Django-doc] to make the field not required:
class User_account(models.Model):
# …
bio = models.CharField(null=True, blank=True, max_length=200)
# …
image = models.ImageField(null=True, blank=True,
Note: Models in Django are written in PascalCase, not snake_case,
so you might want to rename the model fromtoUser_account
UserAccount
.
Source:stackexchange.com