TIMEX
TIMEX

Reputation: 271634

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

picture_url = models.CharField(max_length=2000)

Upvotes: 1

Views: 180

Answers (2)

John Feminella
John Feminella

Reputation: 311476

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

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

Upvotes: 3

buckley
buckley

Reputation: 2110

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

Upvotes: 0

Related Questions