Upgrade to Django 4.1
swh-deposit currently uses Django 2.2. This version explicitly requires psycopg2 ~= 2.8
, as version 2.9 fixed in a way incompatible with Django a loss of precision in timezone handling. Sadly, support for Python 3.11 has been added only in psycopg 2.9.5. This restriction in turn makes swh-deposit incompatible with Python 3.11 (swh/meta#4958).
While hacks are floating around, Django 2.2 is unsupported since April 11, 2022 so it’s probably a good idea to upgrade to a newer version. Support for Python 3.11 has actually been added in Django 4.1.3, so 4.1 should be the target branch.