Django Validationerror Date Format Exception
Hi I check all question about my answer and doesn't find solution. Today I change my CustomUser model and then it stop works. I think, I failed one thing, when django ask me about
Solution 1:
django.core.exceptions.ValidationError: ["'' value has an invalid date format. It must be in YYYY-MM-DD format."]
As the error message says, the empty string is an invalid value for a date. You could either provide a string in the required format, e.g. "2015-11-04"
, or use python's date
, e.g. date.today()
.
However, I'm slightly worried that you have this change in migration 0008
in your migrations. Changing to a custom user in an existing project is extremely tricky (see the warning in the docs). If you delete all your user migrations and recreate them, then it should create the model from scratch, and not ask for a default date at all.
Post a Comment for "Django Validationerror Date Format Exception"