September 1, 2020
Django 3.1.1 fixes two security issues and several bugs in 3.1.
On Python 3.7+, FILE_UPLOAD_DIRECTORY_PERMISSIONS mode was not
applied to intermediate-level directories created in the process of uploading
files and to intermediate-level collected static directories when using the
collectstatic management command.
You should review and manually fix permissions on existing intermediate-level directories.
On Python 3.7+, the intermediate-level directories of the file system cache had
the system’s standard umask rather than 0o077 (no group or others
permissions).
select_for_update(). When using
related fields pointing to a proxy model in the of argument, the
corresponding model was not locked (#%s31866).TemplateView.get_context_data() (#%s31877).MiddlewareMixin.process_request() and process_response() hooks
when in an async context (#%s31905).__in lookup on key transforms for
JSONField with MariaDB, MySQL, Oracle, and SQLite
(#%s31936).CommonPasswordValidator and settings.py generated by the
startproject command, when user didn’t have permissions to all
intermediate directories in a Django installation path (#%s31912).get_response callable in various builtin
middlewares (#%s31928).QuerySet.order_by() crash on PostgreSQL when ordering and
grouping by JSONField with a custom
decoder (#%s31956). As a
consequence, fetching a JSONField with raw SQL now returns a string
instead of pre-loaded data. You will need to explicitly call json.loads()
in such cases.QuerySet.delete() crash on MySQL, following a performance
regression in Django 3.1 on MariaDB 10.3.2+, when filtering against an
aggregate function (#%s31965).django.contrib.admin.EmptyFieldListFilter crash when using on
reverse relations (#%s31952).Sep 26, 2023