add custom backport to django for psycopg2 2.9 compatibility (#58934)

And bump django version to 2.2.24.
This commit is contained in:
Emmanuel Cazenave 2021-12-02 13:07:00 +01:00
parent 76858308a3
commit 5646fb8cf5
3 changed files with 21 additions and 1 deletions

View File

@ -1,6 +1,6 @@
clean_venv: false
compile_theme: true
django_version: 2.2.19
django_version: 2.2.24
git_ssh: false
devinst_share: /usr/local/share/publik-devinst
publik_conf: "/home/{{user}}/.config/publik"

View File

@ -0,0 +1,7 @@
from django.utils.timezone import utc
def utc_tzinfo_factory(offset):
if offset:
raise AssertionError("database connection isn't set to UTC")
return utc

View File

@ -57,6 +57,19 @@
virtualenv: "{{venv_py3}}"
virtualenv_python: "python3"
- name: guess virtualenv python3 site-packages
command: "{{venv_py3_python}} -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'"
register: venv_py3_site_packages_cmd
- name: Set virtualenv python3 site-packages
set_fact:
venv_py3_site_packages: "{{ venv_py3_site_packages_cmd.stdout }}"
- name: copy patched django/db/backends/postgresql/utils.py
copy:
src: utils.py
dest: "{{venv_py3_site_packages}}/django/db/backends/postgresql/utils.py"
- name: install django-debug-toolbar
pip:
name: "django-debug-toolbar<3"