Set created & updated date/time in your models
Its often useful to have the date a record was added, or most recently updated. Django makes this really easy.
Here it is
class Blog(models.Model):
title = models.CharField(max_length=100)
added = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)auto_now_add and auto_now are the two parts the do the magic. auto_now_add tells Django that when you add a new row, you want the current date & time added. auto_now tells Django to add the current date & time will be added EVERY time the record is saved.