You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/usr/local/lib/python3.10/site-packages/django/db/models/fields/__init__.py:1564: RuntimeWarning: DateTimeField Source.due_poll received a naive datetime (1900-01-01 00:00:00) while time zone support is active.
warnings.warn(
I'm not sure off the top of my head the best way to fix this, taking into account the value of USE_TZ and which version of Django is currently used, given the change from pytz to zoneinfo (available in python from 3.9) that happened with Django 4.0. e.g. https://stackoverflow.com/a/71823301/250962
The odd thing is, it sets the timezone to UTC regardless of whether my project has USE_TZ set to True or False, and even if I have USE_TZ = True and TIME_ZONE = 'America/New_York'.
Maybe that's fine? I'm not sure. I guess, given it's over a century ago, it's not that important which timezone it's in :)
Happy to add a pull request for this too - let me know.
If I have
USE_TZ = True
in my settings, and I create a new Source without setting itsdue_poll
field:Then I get this warning:
Because the default value is set like this:
I'm not sure off the top of my head the best way to fix this, taking into account the value of
USE_TZ
and which version of Django is currently used, given the change from pytz to zoneinfo (available in python from 3.9) that happened with Django 4.0. e.g. https://stackoverflow.com/a/71823301/250962And, fwiw, timezone support will be enabled by default with Django 5.0.
The text was updated successfully, but these errors were encountered: