A Django app providing DB, form, and REST framework fields for zoneinfo and pytz timezone objects.
Maintained. Last release 6 months ago, commits in 1 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install django-timezone-fielddjango-timezone-field
A Django app providing DB, form, and REST framework fields for
zoneinfo and pytz timezone
objects.
The transition from pytz to zoneinfo
Like Django, this app supports both pytz and zoneinfo objects while the community transitions away from pytz to
zoneinfo. All exposed fields and functions that return a timezone object accept an optional boolean kwarg use_pytz.
If not explicitly specified, the default value used for use_pytz matches Django's behavior:
- Django <= 3.X:
use_pytzdefaults toTrue - Django == 4.X:
use_pytzdefaults to the value ofdjango.conf.settings.USE_DEPRECATED_PYTZ, which itself defaults toFalse - Django >= 5.X:
drops support for
pytzaltogether, and this app has done the same.
Note that this app does not declare pytz to be a dependency, so if you're using this app with , you'll need
to ensure is included in the environment yourself.