Hello all,
I'm new to this list so please let me know I'm overlooking any sort of etiquette.
I'm having problem trying to use a default value for a DateTimeField. When I specify a default value WITH a timezone I receive the following error during './manage.py makemigrations'
ValueError: Cannot serialize datetime values with timezones. Either use a callable value for default or remove the timezone.
However, if I remove the timezone I receive the following warning during 'migrate'
RuntimeWarning: DateTimeField Verification_link.redeemed received a naive datetime (9999-12-31 23:59:59.999999) while time zone support is active.
I'm just a little confused, I'm crafting a work-around but I would like to know what the correct solution is. Any help would be appreciated.
Code:
from datetime import datetime
from django.utils import timezone
INF_TIME=datetime.max.replace(tzinfo=timezone.utc)
class SomeModel: death = models.DateTimeField(default=INF_TIME)