开发者

In Django, why does this error say that my column can't be null?

开发者 https://www.devze.com 2022-12-20 19:17 出处:网络
picture_url = models.CharField(max_length=20开发者_开发技巧00) You\'ll need to add null=True if the column can be null:
picture_url = models.CharField(max_length=20开发者_开发技巧00)


You'll need to add null=True if the column can be null:

picture_url = models.CharField(max_length=2000, null=True)


By default fields have null set to False try this

picture_url = models.CharField(max_length=2000, blank=True)

http://docs.djangoproject.com/en/1.1/ref/models/fields/#null

0

精彩评论

暂无评论...
验证码 换一张
取 消