2👍
✅
Try this:
created = models.DateTimeField(auto_now_add=True)
There is also auto_now
for an ‘updated on’ field.
Source:stackexchange.com