diff --git a/examples/default/.copier/project.yml b/examples/default/.copier/project.yml index 6f87661..b8b034a 100644 --- a/examples/default/.copier/project.yml +++ b/examples/default/.copier/project.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: b5c2b02 +_commit: 52e7db6 _src_path: . admin_email: admin@example.com author_email: jdoe@example.com @@ -7,7 +7,7 @@ author_name: John Doe current_version: 2024.9.1 default_from_email: johndoe@example.com django_twc_ui_version: 2024.8.27 -django_version: '5.0' +django_version: '5.1' docs_site_name: Default domain_name: default.westervelt.com fly_app_name: default-example_owner diff --git a/examples/default/.pre-commit-config.yaml b/examples/default/.pre-commit-config.yaml index 99dfbbe..651b3ca 100644 --- a/examples/default/.pre-commit-config.yaml +++ b/examples/default/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: rev: 1.21.0 hooks: - id: django-upgrade - args: [--target-version, "5.0"] + args: [--target-version, "5.1"] - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.6.4 diff --git a/examples/default/default/settings.py b/examples/default/default/settings.py index c96deb7..50d6bf7 100644 --- a/examples/default/default/settings.py +++ b/examples/default/default/settings.py @@ -54,7 +54,7 @@ CI = env.bool("CI", default=False) # 1. Django Core Settings -# https://docs.djangoproject.com/en/5.0/ref/settings/ +# https://docs.djangoproject.com/en/5.1/ref/settings/ ALLOWED_HOSTS = env.list( "ALLOWED_HOSTS", default=["*"] if DEBUG else ["localhost"], subcast=str @@ -102,6 +102,15 @@ "DISABLE_SERVER_SIDE_CURSORS", default=True ) + if env.bool("ENABLE_PG_CONN_POOL", default=True): + DATABASES[db_alias]["OPTIONS"] = { + "pool": { + "min_size": env.int("PG_CONN_POOL_MIN_SIZE", default=2), + "max_size": env.int("PG_CONN_POOL_MAX_SIZE", default=4), + "timeout": env.int("PG_CONN_POOL_TIMEOUT", default=10), + } + } + DATABASE_ROUTERS = [ "email_relay.db.EmailDatabaseRouter", ] @@ -213,8 +222,8 @@ MEDIA_URL = "/mediafiles/" -# https://docs.djangoproject.com/en/5.0/topics/http/middleware/ -# https://docs.djangoproject.com/en/5.0/ref/middleware/#middleware-ordering +# https://docs.djangoproject.com/en/5.1/topics/http/middleware/ +# https://docs.djangoproject.com/en/5.1/ref/middleware/#middleware-ordering MIDDLEWARE = [ # should be first "django.middleware.cache.UpdateCacheMiddleware", @@ -248,7 +257,7 @@ SECRET_KEY = env.str( "SECRET_KEY", - default="1d363a5b7b1a1e13c6e99ef493be98ceac5045f59f69cb05f04ecb09963515d0", + default="42eb58172f0c643f17382566b495469df4b095f0f09d30fd2996756aff5f1529", ) SECURE_HSTS_INCLUDE_SUBDOMAINS = PROD diff --git a/examples/default/pyproject.toml b/examples/default/pyproject.toml index f7ba10b..3928afc 100644 --- a/examples/default/pyproject.toml +++ b/examples/default/pyproject.toml @@ -7,7 +7,7 @@ authors = [{name = "John Doe", email = "jdoe@example.com"}] dependencies = [ "attrs", "croniter", - "django<5.1", + "django<5.2", "django-allauth[socialaccount]", "django-charid-field", "django-click", @@ -39,7 +39,7 @@ dependencies = [ "heroicons[django]", "httpx", "openpyxl", - "psycopg[binary]", + "psycopg[binary, pool]", "sentry-sdk[django]", "whitenoise" ] diff --git a/examples/postgis/.copier/project.yml b/examples/postgis/.copier/project.yml index a6a70b0..929badc 100644 --- a/examples/postgis/.copier/project.yml +++ b/examples/postgis/.copier/project.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: a6cca1e +_commit: 035fc1b _src_path: . admin_email: admin@example.com author_email: jdoe@example.com @@ -7,7 +7,7 @@ author_name: John Doe current_version: 2024.9.1 default_from_email: johndoe@example.com django_twc_ui_version: 2024.8.27 -django_version: '5.0' +django_version: '5.1' docs_site_name: Default domain_name: default.westervelt.com fly_app_name: default-example_owner diff --git a/examples/postgis/.pre-commit-config.yaml b/examples/postgis/.pre-commit-config.yaml index 99dfbbe..651b3ca 100644 --- a/examples/postgis/.pre-commit-config.yaml +++ b/examples/postgis/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: rev: 1.21.0 hooks: - id: django-upgrade - args: [--target-version, "5.0"] + args: [--target-version, "5.1"] - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.6.4 diff --git a/examples/postgis/default/settings.py b/examples/postgis/default/settings.py index 6f3fcf0..0773480 100644 --- a/examples/postgis/default/settings.py +++ b/examples/postgis/default/settings.py @@ -54,7 +54,7 @@ CI = env.bool("CI", default=False) # 1. Django Core Settings -# https://docs.djangoproject.com/en/5.0/ref/settings/ +# https://docs.djangoproject.com/en/5.1/ref/settings/ ALLOWED_HOSTS = env.list( "ALLOWED_HOSTS", default=["*"] if DEBUG else ["localhost"], subcast=str @@ -102,6 +102,15 @@ "DISABLE_SERVER_SIDE_CURSORS", default=True ) + if env.bool("ENABLE_PG_CONN_POOL", default=True): + DATABASES[db_alias]["OPTIONS"] = { + "pool": { + "min_size": env.int("PG_CONN_POOL_MIN_SIZE", default=2), + "max_size": env.int("PG_CONN_POOL_MAX_SIZE", default=4), + "timeout": env.int("PG_CONN_POOL_TIMEOUT", default=10), + } + } + DATABASE_ROUTERS = [ "email_relay.db.EmailDatabaseRouter", ] @@ -213,8 +222,8 @@ MEDIA_URL = "/mediafiles/" -# https://docs.djangoproject.com/en/5.0/topics/http/middleware/ -# https://docs.djangoproject.com/en/5.0/ref/middleware/#middleware-ordering +# https://docs.djangoproject.com/en/5.1/topics/http/middleware/ +# https://docs.djangoproject.com/en/5.1/ref/middleware/#middleware-ordering MIDDLEWARE = [ # should be first "django.middleware.cache.UpdateCacheMiddleware", @@ -248,7 +257,7 @@ SECRET_KEY = env.str( "SECRET_KEY", - default="ce2058959740529123cdd14374bb5fefd408a14440ae1449465725bc084edf8a", + default="dd671264a29a6ea5842149293892c274fb25e35085d02e0a07d15ba49282e87f", ) SECURE_HSTS_INCLUDE_SUBDOMAINS = PROD diff --git a/examples/postgis/pyproject.toml b/examples/postgis/pyproject.toml index f7ba10b..3928afc 100644 --- a/examples/postgis/pyproject.toml +++ b/examples/postgis/pyproject.toml @@ -7,7 +7,7 @@ authors = [{name = "John Doe", email = "jdoe@example.com"}] dependencies = [ "attrs", "croniter", - "django<5.1", + "django<5.2", "django-allauth[socialaccount]", "django-charid-field", "django-click", @@ -39,7 +39,7 @@ dependencies = [ "heroicons[django]", "httpx", "openpyxl", - "psycopg[binary]", + "psycopg[binary, pool]", "sentry-sdk[django]", "whitenoise" ] diff --git a/examples/with_vite/.copier/project.yml b/examples/with_vite/.copier/project.yml index 99bda7a..9a60c99 100644 --- a/examples/with_vite/.copier/project.yml +++ b/examples/with_vite/.copier/project.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 1a2cdb4 +_commit: 1c3c79c _src_path: . admin_email: admin@example.com author_email: jdoe@example.com @@ -7,7 +7,7 @@ author_name: John Doe current_version: 2024.9.1 default_from_email: johndoe@example.com django_twc_ui_version: 2024.8.27 -django_version: '5.0' +django_version: '5.1' docs_site_name: With_Vite domain_name: with_vite.westervelt.com fly_app_name: with_vite-example_owner diff --git a/examples/with_vite/.pre-commit-config.yaml b/examples/with_vite/.pre-commit-config.yaml index 99dfbbe..651b3ca 100644 --- a/examples/with_vite/.pre-commit-config.yaml +++ b/examples/with_vite/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: rev: 1.21.0 hooks: - id: django-upgrade - args: [--target-version, "5.0"] + args: [--target-version, "5.1"] - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.6.4 diff --git a/examples/with_vite/pyproject.toml b/examples/with_vite/pyproject.toml index 4f0da04..4f053db 100644 --- a/examples/with_vite/pyproject.toml +++ b/examples/with_vite/pyproject.toml @@ -7,7 +7,7 @@ authors = [{name = "John Doe", email = "jdoe@example.com"}] dependencies = [ "attrs", "croniter", - "django<5.1", + "django<5.2", "django-allauth[socialaccount]", "django-charid-field", "django-click", @@ -40,7 +40,7 @@ dependencies = [ "heroicons[django]", "httpx", "openpyxl", - "psycopg[binary]", + "psycopg[binary, pool]", "sentry-sdk[django]", "whitenoise" ] diff --git a/examples/with_vite/with_vite/settings.py b/examples/with_vite/with_vite/settings.py index 45b0e5b..6048bf9 100644 --- a/examples/with_vite/with_vite/settings.py +++ b/examples/with_vite/with_vite/settings.py @@ -54,7 +54,7 @@ CI = env.bool("CI", default=False) # 1. Django Core Settings -# https://docs.djangoproject.com/en/5.0/ref/settings/ +# https://docs.djangoproject.com/en/5.1/ref/settings/ ALLOWED_HOSTS = env.list( "ALLOWED_HOSTS", default=["*"] if DEBUG else ["localhost"], subcast=str @@ -102,6 +102,15 @@ "DISABLE_SERVER_SIDE_CURSORS", default=True ) + if env.bool("ENABLE_PG_CONN_POOL", default=True): + DATABASES[db_alias]["OPTIONS"] = { + "pool": { + "min_size": env.int("PG_CONN_POOL_MIN_SIZE", default=2), + "max_size": env.int("PG_CONN_POOL_MAX_SIZE", default=4), + "timeout": env.int("PG_CONN_POOL_TIMEOUT", default=10), + } + } + DATABASE_ROUTERS = [ "email_relay.db.EmailDatabaseRouter", ] @@ -214,8 +223,8 @@ MEDIA_URL = "/mediafiles/" -# https://docs.djangoproject.com/en/5.0/topics/http/middleware/ -# https://docs.djangoproject.com/en/5.0/ref/middleware/#middleware-ordering +# https://docs.djangoproject.com/en/5.1/topics/http/middleware/ +# https://docs.djangoproject.com/en/5.1/ref/middleware/#middleware-ordering MIDDLEWARE = [ # should be first "django.middleware.cache.UpdateCacheMiddleware", @@ -249,7 +258,7 @@ SECRET_KEY = env.str( "SECRET_KEY", - default="a3d16090dfcb9188bf2cd7f35455e71e50dde8605db3f5582c9f630e1bd9e1e8", + default="af6bedb092aa8b092f9125562563a8dd1e3f9f4c1c9be7cc90430d447370a669", ) SECURE_HSTS_INCLUDE_SUBDOMAINS = PROD