© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Seth Livingston
Technical Lead for CultureMap, InnovationMap, SportsMap, & AutomotiveMap. Python, Django, Elm, & JavaScript.
Setting auto_now and auto_now_add to True will automatically set a DateField or a DateTimeField to the current date and time. This works great for "created" and "modified" fields. However, suppose you're importing content from another system, and you...
Mark
(And don't accidentally write
created = models.DateTimeField(default=timezone.now())
because then you get the server start time. Not that I ever did something like that and not notice it for weeks...)
Mark
(And don't accidentally write
created = models.DateTimeField(default=timezone.now())because then you get the server start time. Not that I ever did something like that and not notice it for weeks...)