[Answer]-Make django date not editable

1đź‘Ť

âś…

Change auto_now to auto_now_add.

From django docs:

DateField.auto_now

Automatically set the field to now every time the object is saved.
Useful for “last-modified” timestamps. Note that the current date is
always used; it’s not just a default value that you can override.

DateField.auto_now_add

Automatically set the field to now when the object is first created.
Useful for creation of timestamps. Note that the current date is
always used; it’s not just a default value that you can override.

👤szaman

Leave a comment