I'm trying to set a date field to a constant date. My "models.py" with the date field:
class Foo(models.Model):
bar = models.DateField()
In my view:
import datetime
from app.models import Foo
foo = Foo(bar=datetime.date('1/1/2021'))
The error:
Exception Type: TypeError
Exception Value: an integer is required (got type str)