From 5bb2cd49b4cf4fdd37b15bb3eb070f8dac570bf4 Mon Sep 17 00:00:00 2001 From: Vadim Sikora Date: Thu, 15 Aug 2024 14:22:50 +0200 Subject: [PATCH 1/3] feat(django): Update django to 5.1.x --- requirements.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.in b/requirements.in index 5f24c3c..2b71dea 100644 --- a/requirements.in +++ b/requirements.in @@ -1,4 +1,4 @@ -Django>=4.2,<5.1 +Django>=5.1,<5.2 dj-database-url==2.2.0 psycopg[binary]>=3.1,<3.2 gunicorn>=22 From 74c37506687cc9648c34ca1132d92f31ea8cc22b Mon Sep 17 00:00:00 2001 From: Vadim Sikora Date: Thu, 15 Aug 2024 14:23:12 +0200 Subject: [PATCH 2/3] chore(localdev): Update docker-compose.yml so that admin works locally out of the box --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 58617d9..ae59964 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,7 @@ services: - "./data:/data:rw" environment: DATABASE_URL: postgres://postgres@database_default:5432/db + DEBUG: 'True' links: - "database_default" # The following command is used to start the local development server. From 851e5e0c8b6e0827c724eda2bfc0991396275a7f Mon Sep 17 00:00:00 2001 From: Vadim Sikora Date: Thu, 15 Aug 2024 14:29:56 +0200 Subject: [PATCH 3/3] chore(django): Recreated starter project with 5.1 --- mysite/asgi.py | 4 ++-- mysite/settings.py | 24 ++++++++++++------------ mysite/urls.py | 4 ++-- mysite/wsgi.py | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mysite/asgi.py b/mysite/asgi.py index a391ebd..44c7dff 100644 --- a/mysite/asgi.py +++ b/mysite/asgi.py @@ -1,10 +1,10 @@ """ -ASGI config. +ASGI config for mysite project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see -https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/ +https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/ """ import os diff --git a/mysite/settings.py b/mysite/settings.py index 8e8a691..89ddc28 100644 --- a/mysite/settings.py +++ b/mysite/settings.py @@ -1,13 +1,13 @@ """ -Django settings. +Django settings for mysite project. -Generated by 'django-admin startproject'. +Generated by 'django-admin startproject' using Django 5.1. For more information on this file, see -https://docs.djangoproject.com/en/5.0/topics/settings/ +https://docs.djangoproject.com/en/5.1/topics/settings/ For the full list of settings and their values, see -https://docs.djangoproject.com/en/5.0/ref/settings/ +https://docs.djangoproject.com/en/5.1/ref/settings/ """ import os @@ -21,7 +21,7 @@ # Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/ +# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = os.environ.get('SECRET_KEY', 'changeme') @@ -78,7 +78,7 @@ # Database -# https://docs.djangoproject.com/en/5.0/ref/settings/#databases +# https://docs.djangoproject.com/en/5.1/ref/settings/#databases if "DATABASE_URL" in os.environ: DATABASES = {'default': dj_database_url.config(conn_max_age=500)} @@ -92,7 +92,7 @@ # Password validation -# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators +# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { @@ -111,7 +111,7 @@ # Internationalization -# https://docs.djangoproject.com/en/5.0/topics/i18n/ +# https://docs.djangoproject.com/en/5.1/topics/i18n/ LANGUAGE_CODE = 'en-us' @@ -123,7 +123,7 @@ # Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/5.0/howto/static-files/ +# https://docs.djangoproject.com/en/5.1/howto/static-files/ STATIC_URL = '/static/' STATIC_ROOT = BASE_DIR / 'staticfiles' @@ -143,7 +143,7 @@ # Default storage settings, with the staticfiles storage updated. -# See https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-STORAGES +# See https://docs.djangoproject.com/en/5.1/ref/settings/#std-setting-STORAGES STORAGE_BACKEND = "django.core.files.storage.FileSystemStorage" if AWS_SECRET_ACCESS_KEY: @@ -155,7 +155,7 @@ }, # ManifestStaticFilesStorage is recommended in production, to prevent # outdated JavaScript / CSS assets being served from cache - # See https://docs.djangoproject.com/en/5.0/ref/contrib/staticfiles/#manifeststaticfilesstorage + # See https://docs.djangoproject.com/en/5.1/ref/contrib/staticfiles/#manifeststaticfilesstorage "staticfiles": { "BACKEND": "django.contrib.staticfiles.storage.ManifestStaticFilesStorage", }, @@ -163,6 +163,6 @@ # Default primary key field type -# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field +# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/mysite/urls.py b/mysite/urls.py index 7520a15..5e8bffe 100644 --- a/mysite/urls.py +++ b/mysite/urls.py @@ -1,8 +1,8 @@ """ -URL configuration. +URL configuration for mysite project. The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/5.0/topics/http/urls/ + https://docs.djangoproject.com/en/5.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views diff --git a/mysite/wsgi.py b/mysite/wsgi.py index 4771ef1..61b0d9d 100644 --- a/mysite/wsgi.py +++ b/mysite/wsgi.py @@ -1,10 +1,10 @@ """ -WSGI config. +WSGI config for mysite project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see -https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/ +https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/ """ import os