[Fixed]-I cannot add a datetime field in django model

1👍

Delete the migration folder. And then execute

python manage.py makemigrations
python manage.py migrate

0👍

You can modify the created field like this

created = models.DateTimeField(default=date.today, blank=True,null=True)

Check the documentation for auto_now_add

Leave a comment