emencia / django-blog-lotus

A weblog application with Django.
https://django-blog-lotus.readthedocs.io/
MIT License
5 stars 1 forks source link

Move to zoneinfo instead of pytz #38

Closed sveetch closed 1 year ago

sveetch commented 1 year ago

Is your feature request related to a problem? Please describe. Django 4.0 included a move to zoneinfo instead of Pytz for timezone in datetime/time. Pytz support will be totally remove in Django 5.0

Describe the solution you'd like Currently a transitional settings USE_DEPRECATED_PYTZ is used to keep pytz usage since we have Django<4.0 support that don't have the zoneinfo support.

We should drop this settings and move to zoneinfo usage instead of pytz everywhere it is directly used.

Describe alternatives you've considered Including a support for both libraries would be too difficult to manage.

sveetch commented 1 year ago

Also now Django>=4.0 there is this warnings:

The django.utils.timezone.utc alias is deprecated. Please update your code to use datetime.timezone.utc instead.

And

The USE_L10N setting is deprecated. Starting with Django 5.0, localized formatting of data will always be enabled. For example Django will display numbers and dates using the format of the current locale.

These should not be difficult to fix but only when dropping Django<4.0 supports.

sveetch commented 1 year ago

Done with #34