Upgrade to Django 3.1
The latest Django version seems to introduce more backward incompatible changes than the release notes reveal.
Concretely, there are problems with the database:
django ImportError: cannot import name 'ORDER_PATTERN' from 'django.db.models.sql.constants'