Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django <= 3.X defaults to using ZoneInfoBackend instead of PYTZBackend #109

Closed
mcastle opened this issue Sep 6, 2023 · 2 comments · Fixed by #110
Closed

Django <= 3.X defaults to using ZoneInfoBackend instead of PYTZBackend #109

mcastle opened this issue Sep 6, 2023 · 2 comments · Fixed by #110

Comments

@mcastle
Copy link

mcastle commented Sep 6, 2023

This is because without explicitly setting use_pytz=True in a TimeZoneField, use_pytz defaults to None, causing get_tz_backend to return ZoneInfoBackend instead of the intended PYTZBackend.

A workaround ahead of a code fix is to explicitly set use_pytz=True in a TimeZoneField.

@mcastle mcastle changed the title For model fields, 'use_pytz' defaults to 'None' instead of 'True' for Django <= 3.X For model fields, use_pytz'defaults to None instead of True for Django <= 3.X Sep 6, 2023
@mcastle mcastle changed the title For model fields, use_pytz'defaults to None instead of True for Django <= 3.X For model fields, use_pytz defaults to None instead of True for Django <= 3.X Sep 6, 2023
@mcastle mcastle changed the title For model fields, use_pytz defaults to None instead of True for Django <= 3.X Django <= 3.X defaults to using ZoneInfoBackend Sep 6, 2023
@mcastle mcastle changed the title Django <= 3.X defaults to using ZoneInfoBackend Django <= 3.X defaults to using ZoneInfoBackend instead of PYTZBackend Sep 6, 2023
mfogel added a commit that referenced this issue Sep 7, 2023
@mfogel
Copy link
Owner

mfogel commented Sep 7, 2023

I just merged a PR to fix this on main. Planning to push a new release of this project tomorrow evening pacific time to pypi with this fix in it.

Sorry for the oversight!

@mcastle
Copy link
Author

mcastle commented Sep 7, 2023

No apologies necessary. Really useful project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants