Django statement to save date and time when a button is clicked
Inside your model class, add this:created_at = models.DateTimeField(auto_now_add=True)It assigns current time when object is created.You can retrieve that data in html file by using:
{{ object.created_at }}
I'm making a notes creator web application in django and I want to save the date and time when a note is created. (i.e. save date and time as soon as 'Submit' button is clicked.) What could be the django statement to do the same ?