From 602f4685283d235968343f00d61cde9d8696d9e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Riku=20Kestila=CC=88?= Date: Wed, 3 Apr 2024 15:28:29 +0300 Subject: [PATCH] chore: update Django to 4.2 LTS --- .env.benefit-backend.example | 2 +- backend/benefit/README.md | 2 ++ backend/benefit/helsinkibenefit/settings.py | 12 +++++++++--- backend/benefit/requirements.in | 2 +- backend/benefit/requirements.txt | 5 ++--- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.env.benefit-backend.example b/.env.benefit-backend.example index 233bbecf53..e670c3a837 100644 --- a/.env.benefit-backend.example +++ b/.env.benefit-backend.example @@ -60,7 +60,7 @@ AZURE_CONTAINER= MEDIA_ROOT=/app/var/media CSRF_COOKIE_NAME=yjdhcsrftoken -CSRF_TRUSTED_ORIGINS="localhost:3000,localhost:3100" +CSRF_TRUSTED_ORIGINS="https://localhost:3000,https://localhost:3100" YRTTI_BASE_URL=https://yrtti-integration-test.agw.arodevtest.hel.fi/api YRTTI_AUTH_PASSWORD= diff --git a/backend/benefit/README.md b/backend/benefit/README.md index afc7004406..c98a963d44 100644 --- a/backend/benefit/README.md +++ b/backend/benefit/README.md @@ -110,6 +110,8 @@ application using the applicant UI. 1. Install `pip-tools`: - `pip install pip-tools` + - `pip install --upgrade pip-tools` + 2. Add new packages to `requirements.in` or `requirements-dev.in` diff --git a/backend/benefit/helsinkibenefit/settings.py b/backend/benefit/helsinkibenefit/settings.py index 6c7c89230a..ce66d8d352 100644 --- a/backend/benefit/helsinkibenefit/settings.py +++ b/backend/benefit/helsinkibenefit/settings.py @@ -48,7 +48,7 @@ CORS_ALLOWED_ORIGINS=(list, []), CORS_ALLOW_ALL_ORIGINS=(bool, False), CSRF_COOKIE_DOMAIN=(str, "localhost"), - CSRF_TRUSTED_ORIGINS=(list, ["localhost:3000", "localhost:3100"]), + CSRF_TRUSTED_ORIGINS=(list, ["https://localhost:3000", "https://localhost:3100"]), CSRF_COOKIE_NAME=(str, "yjdhcsrftoken"), YTJ_BASE_URL=(str, "https://avoindata.prh.fi"), YTJ_TIMEOUT=(int, 30), @@ -468,8 +468,14 @@ FIELD_ENCRYPTION_KEYS = [ENCRYPTION_KEY] # Django storages -DEFAULT_FILE_STORAGE = env("DEFAULT_FILE_STORAGE") - +STORAGES = { + "default": { + "BACKEND": env("DEFAULT_FILE_STORAGE"), + }, + "staticfiles": { + "BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage", + }, +} AZURE_ACCOUNT_NAME = env("AZURE_ACCOUNT_NAME") AZURE_ACCOUNT_KEY = env("AZURE_ACCOUNT_KEY") AZURE_CONTAINER = env("AZURE_CONTAINER") diff --git a/backend/benefit/requirements.in b/backend/benefit/requirements.in index 58c424a831..1d61a40c2d 100644 --- a/backend/benefit/requirements.in +++ b/backend/benefit/requirements.in @@ -12,7 +12,7 @@ django-sql-utils django-storages[azure] django_auth_adfs djangorestframework -django~=3.2.23 +django~=4.2.11 drf-nested-routers drf-spectacular elasticsearch~=7.17 # TODO: remove and update to 8.x when elasticsearch servers are updated to elasticsearch 8 diff --git a/backend/benefit/requirements.txt b/backend/benefit/requirements.txt index f58f52d73e..758fbc8bef 100644 --- a/backend/benefit/requirements.txt +++ b/backend/benefit/requirements.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.9 # by the following command: # -# pip-compile +# pip-compile requirements.in # -e file:../shared # via -r requirements.in @@ -41,7 +41,7 @@ defusedxml==0.7.1 # pysaml2 deprecation==2.1.0 # via django-helusers -django==3.2.23 +django==4.2.11 # via # -r requirements.in # django-auth-adfs @@ -185,7 +185,6 @@ python-stdnum==1.19 pytz==2022.7.1 # via # babel - # django # djangorestframework # pysaml2 pyyaml==6.0