Hello all,
I'm new to this list so please let me know I'm overlooking any sort of e
tiquette.
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)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6897ba3c-c93e-4dba-8218-a6eb992a8f7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to