How django time zone works with model.field's auto_now_add
The problem is on your end: datetime.now()
is not TZ aware, so you're the one feeding in a naive TZ. See the Django docs on this issue. The reason it works when setting default=datetime.now
is that you're forcing the value to a naive datetime, so when you later compare it with another naive datetime, there's no problem.
You need to get "now" the following way:
import datetimefrom django.utils.timezone import utcnow = datetime.datetime.utcnow().replace(tzinfo=utc)