From aeae55a05b23db681b9da5c55c1c103fc0cba6d0 Mon Sep 17 00:00:00 2001 From: Moe Date: Mon, 1 Apr 2024 00:39:47 +0300 Subject: [PATCH] feat: Add django-post_office for mail queueing (#359) * feat: Use django-post_office for mail queueing * Override the base setting in dev setting. --------- Co-authored-by: Tim Schilling --- indymeet/settings/base.py | 9 + indymeet/settings/dev.py | 2 +- indymeet/settings/production.py | 1 - requirements/requirements-dev.txt | 293 +++++++++++++++-------------- requirements/requirements-test.txt | 143 +++++++------- requirements/requirements.in | 1 + requirements/requirements.txt | 46 +++-- supervisord.conf | 8 + 8 files changed, 269 insertions(+), 234 deletions(-) diff --git a/indymeet/settings/base.py b/indymeet/settings/base.py index b17d5e4a..0f7b1029 100644 --- a/indymeet/settings/base.py +++ b/indymeet/settings/base.py @@ -66,6 +66,7 @@ "tailwind", "theme", "widget_tweaks", + "post_office", ] MIDDLEWARE = [ @@ -222,6 +223,14 @@ SERVER_EMAIL = "contact@djangonaut.space" SILENCED_SYSTEM_CHECKS = ["django_recaptcha.recaptcha_test_key_error"] +EMAIL_BACKEND = "post_office.EmailBackend" + +POST_OFFICE = { + "BACKENDS": { + "default": "anymail.backends.mailjet.EmailBackend", + } +} + PUPUT_AS_PLUGIN = True PUPUT_ENTRY_MODEL = "home.models.BlogAbstract" diff --git a/indymeet/settings/dev.py b/indymeet/settings/dev.py index 778b9e53..ca9cc52b 100644 --- a/indymeet/settings/dev.py +++ b/indymeet/settings/dev.py @@ -21,7 +21,7 @@ # SECURITY WARNING: define the correct hosts in production! ALLOWED_HOSTS = ["*"] -EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" +POST_OFFICE["BACKENDS"] = {"default": "django.core.mail.backends.console.EmailBackend"} INSTALLED_APPS += ["django_extensions"] # noqa F405 diff --git a/indymeet/settings/production.py b/indymeet/settings/production.py index a2bd5da9..fefbac4d 100644 --- a/indymeet/settings/production.py +++ b/indymeet/settings/production.py @@ -36,7 +36,6 @@ # unless there was a setting that needs it. DATABASES["default"].setdefault("OPTIONS", {})["sslmode"] = "require" - EMAIL_BACKEND = "anymail.backends.mailjet.EmailBackend" MAILJET_API_KEY = os.getenv("MAILJET_API_KEY") MAILJET_SECRET_KEY = os.getenv("MAILJET_SECRET_KEY") ANYMAIL = { diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index 68f021df..b30f63b5 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -6,81 +6,82 @@ # anyascii==0.3.2 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail anyio==4.2.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # azure-core asgiref==3.7.2 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # django # django-browser-reload azure-core==1.29.6 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # azure-storage-blob azure-storage-blob==12.19.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt beautifulsoup4==4.11.2 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail bleach==4.1.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt + # django-post-office # wagtail-markdown build==1.0.3 # via pip-tools certifi==2023.11.17 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # requests # sentry-sdk cffi==1.16.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # cryptography cfgv==3.4.0 # via pre-commit charset-normalizer==3.3.2 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # requests click==8.1.7 # via pip-tools cryptography==41.0.7 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # azure-storage-blob defusedxml==0.7.1 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # willow distlib==0.3.8 # via virtualenv dj-database-url==2.1.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt django==4.1.13 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # dj-database-url # django-anymail # django-browser-reload @@ -91,6 +92,7 @@ django==4.1.13 # django-filter # django-modelcluster # django-permissionedforms + # django-post-office # django-recaptcha # django-storages # django-taggit @@ -101,192 +103,196 @@ django==4.1.13 # wagtail django-anymail==10.3 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt django-browser-reload==1.12.1 # via django-tailwind django-colorful==1.3 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # puput django-debug-toolbar==4.3.0 # via - # -r requirements-dev.in - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-dev.in + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt django-el-pagination==4.0.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # puput django-extensions==3.2.3 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt django-filter==22.1 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail django-modelcluster==6.2.1 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail django-permissionedforms==0.1 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail +django-post-office==3.8.0 + # via -r requirements/requirements.txt django-recaptcha==4.0.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt django-social-share==2.3.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # puput django-storages==1.13.2 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt django-taggit==3.1.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # puput # wagtail django-tailwind==3.8.0 # via - # -r requirements-dev.in - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-dev.in + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt django-treebeard==4.7 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail django-widget-tweaks==1.5.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt djangorestframework==3.14.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail draftjs-exporter==2.1.7 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail et-xmlfile==1.1.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # openpyxl +exceptiongroup==1.2.0 + # via -r requirements/requirements-test.txt factory-boy==3.3.0 - # via -r requirements-test.txt + # via -r requirements/requirements-test.txt faker==23.2.1 # via - # -r requirements-test.txt + # -r requirements/requirements-test.txt # factory-boy filelock==3.13.1 # via virtualenv filetype==1.2.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # willow freezegun==1.4.0 - # via -r requirements-test.txt + # via -r requirements/requirements-test.txt greenlet==3.0.3 # via - # -r requirements-test.txt + # -r requirements/requirements-test.txt # playwright html5lib==1.1 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail identify==2.5.33 # via pre-commit idna==3.6 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # anyio # requests iniconfig==2.0.0 # via - # -r requirements-test.txt + # -r requirements/requirements-test.txt # pytest isodate==0.6.1 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # azure-storage-blob l18n==2021.3 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail markdown==3.5.2 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail-markdown nodeenv==1.8.0 # via pre-commit openpyxl==3.1.2 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail packaging==23.2 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # bleach # build # pytest pillow==10.2.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail pip-tools==7.4.1 - # via -r requirements-dev.in + # via -r requirements/requirements-dev.in platformdirs==4.1.0 # via virtualenv playwright==1.42.0 # via - # -r requirements-test.txt + # -r requirements/requirements-test.txt # pytest-playwright pluggy==1.3.0 # via - # -r requirements-test.txt + # -r requirements/requirements-test.txt # pytest pre-commit==3.7.0 - # via -r requirements-dev.in + # via -r requirements/requirements-dev.in psycopg2-binary==2.9.9 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt puput==2.0.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt pycparser==2.21 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # cffi pyee==11.0.1 # via - # -r requirements-test.txt + # -r requirements/requirements-test.txt # playwright pyproject-hooks==1.0.0 # via @@ -294,59 +300,60 @@ pyproject-hooks==1.0.0 # pip-tools pytest==7.4.4 # via - # -r requirements-test.txt + # -r requirements/requirements-test.txt # pytest-base-url # pytest-django # pytest-mock # pytest-playwright pytest-base-url==2.0.0 # via - # -r requirements-test.txt + # -r requirements/requirements-test.txt # pytest-playwright pytest-django==4.8.0 - # via -r requirements-test.txt + # via -r requirements/requirements-test.txt pytest-mock==3.14.0 - # via -r requirements-test.txt + # via -r requirements/requirements-test.txt pytest-playwright==0.4.4 - # via -r requirements-test.txt + # via -r requirements/requirements-test.txt python-dateutil==2.8.2 # via - # -r requirements-test.txt + # -r requirements/requirements-test.txt # faker # freezegun python-dotenv==1.0.1 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt python-slugify==8.0.1 # via - # -r requirements-test.txt + # -r requirements/requirements-test.txt # pytest-playwright pytz==2023.3.post1 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # django-modelcluster + # django-post-office # djangorestframework # l18n pyyaml==6.0.1 # via pre-commit requests==2.31.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # azure-core # django-anymail # pytest-base-url # wagtail sentry-sdk==1.40.4 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt six==1.16.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # azure-core # bleach # html5lib @@ -355,47 +362,47 @@ six==1.16.0 # python-dateutil sniffio==1.3.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # anyio soupsieve==2.5 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # beautifulsoup4 sqlparse==0.4.4 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # django # django-debug-toolbar supervisor==4.2.5 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt telepath==0.3.1 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail text-unidecode==1.3 # via - # -r requirements-test.txt + # -r requirements/requirements-test.txt # python-slugify typing-extensions==4.10.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # azure-core # azure-storage-blob # dj-database-url # pyee unittest-parametrize==1.4.0 - # via -r requirements-test.txt + # via -r requirements/requirements-test.txt urllib3==2.2.1 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # django-anymail # requests # sentry-sdk @@ -403,31 +410,31 @@ virtualenv==20.25.0 # via pre-commit wagtail==5.0.5 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # puput # wagtail-markdown wagtail-markdown==0.11.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # puput webencodings==0.5.1 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # bleach # html5lib wheel==0.42.0 # via pip-tools whitenoise==6.6.0 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt willow==1.6.3 # via - # -r requirements-test.txt - # -r requirements.txt + # -r requirements/requirements-test.txt + # -r requirements/requirements.txt # wagtail # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/requirements-test.txt b/requirements/requirements-test.txt index 7c859948..1dbe6cec 100644 --- a/requirements/requirements-test.txt +++ b/requirements/requirements-test.txt @@ -6,56 +6,57 @@ # anyascii==0.3.2 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail anyio==4.2.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # azure-core asgiref==3.7.2 # via - # -r requirements.txt + # -r requirements/requirements.txt # django azure-core==1.29.6 # via - # -r requirements.txt + # -r requirements/requirements.txt # azure-storage-blob azure-storage-blob==12.19.0 - # via -r requirements.txt + # via -r requirements/requirements.txt beautifulsoup4==4.11.2 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail bleach==4.1.0 # via - # -r requirements.txt + # -r requirements/requirements.txt + # django-post-office # wagtail-markdown certifi==2023.11.17 # via - # -r requirements.txt + # -r requirements/requirements.txt # requests # sentry-sdk cffi==1.16.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # cryptography charset-normalizer==3.3.2 # via - # -r requirements.txt + # -r requirements/requirements.txt # requests cryptography==41.0.7 # via - # -r requirements.txt + # -r requirements/requirements.txt # azure-storage-blob defusedxml==0.7.1 # via - # -r requirements.txt + # -r requirements/requirements.txt # willow dj-database-url==2.1.0 - # via -r requirements.txt + # via -r requirements/requirements.txt django==4.1.13 # via - # -r requirements.txt + # -r requirements/requirements.txt # dj-database-url # django-anymail # django-colorful @@ -65,6 +66,7 @@ django==4.1.13 # django-filter # django-modelcluster # django-permissionedforms + # django-post-office # django-recaptcha # django-storages # django-taggit @@ -74,131 +76,133 @@ django==4.1.13 # puput # wagtail django-anymail==10.3 - # via -r requirements.txt + # via -r requirements/requirements.txt django-colorful==1.3 # via - # -r requirements.txt + # -r requirements/requirements.txt # puput django-debug-toolbar==4.3.0 - # via -r requirements.txt + # via -r requirements/requirements.txt django-el-pagination==4.0.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # puput django-extensions==3.2.3 - # via -r requirements.txt + # via -r requirements/requirements.txt django-filter==22.1 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail django-modelcluster==6.2.1 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail django-permissionedforms==0.1 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail +django-post-office==3.8.0 + # via -r requirements/requirements.txt django-recaptcha==4.0.0 - # via -r requirements.txt + # via -r requirements/requirements.txt django-social-share==2.3.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # puput django-storages==1.13.2 - # via -r requirements.txt + # via -r requirements/requirements.txt django-taggit==3.1.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # puput # wagtail django-tailwind==3.8.0 - # via -r requirements.txt + # via -r requirements/requirements.txt django-treebeard==4.7 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail django-widget-tweaks==1.5.0 - # via -r requirements.txt + # via -r requirements/requirements.txt djangorestframework==3.14.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail draftjs-exporter==2.1.7 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail et-xmlfile==1.1.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # openpyxl factory-boy==3.3.0 - # via -r requirements-test.in + # via -r requirements/requirements-test.in faker==23.2.1 # via factory-boy filetype==1.2.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # willow freezegun==1.4.0 - # via -r requirements-test.in + # via -r requirements/requirements-test.in greenlet==3.0.3 # via playwright html5lib==1.1 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail idna==3.6 # via - # -r requirements.txt + # -r requirements/requirements.txt # anyio # requests iniconfig==2.0.0 # via pytest isodate==0.6.1 # via - # -r requirements.txt + # -r requirements/requirements.txt # azure-storage-blob l18n==2021.3 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail markdown==3.5.2 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail-markdown openpyxl==3.1.2 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail packaging==23.2 # via - # -r requirements.txt + # -r requirements/requirements.txt # bleach # pytest pillow==10.2.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail playwright==1.42.0 # via - # -r requirements-test.in + # -r requirements/requirements-test.in # pytest-playwright pluggy==1.3.0 # via pytest psycopg2-binary==2.9.9 - # via -r requirements.txt + # via -r requirements/requirements.txt puput==2.0.0 - # via -r requirements.txt + # via -r requirements/requirements.txt pycparser==2.21 # via - # -r requirements.txt + # -r requirements/requirements.txt # cffi pyee==11.0.1 # via playwright pytest==7.4.4 # via - # -r requirements-test.in + # -r requirements/requirements-test.in # pytest-base-url # pytest-django # pytest-mock @@ -206,37 +210,38 @@ pytest==7.4.4 pytest-base-url==2.0.0 # via pytest-playwright pytest-django==4.8.0 - # via -r requirements-test.in + # via -r requirements/requirements-test.in pytest-mock==3.14.0 - # via -r requirements-test.in + # via -r requirements/requirements-test.in pytest-playwright==0.4.4 - # via -r requirements-test.in + # via -r requirements/requirements-test.in python-dateutil==2.8.2 # via # faker # freezegun python-dotenv==1.0.1 - # via -r requirements.txt + # via -r requirements/requirements.txt python-slugify==8.0.1 # via pytest-playwright pytz==2023.3.post1 # via - # -r requirements.txt + # -r requirements/requirements.txt # django-modelcluster + # django-post-office # djangorestframework # l18n requests==2.31.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # azure-core # django-anymail # pytest-base-url # wagtail sentry-sdk==1.40.4 - # via -r requirements.txt + # via -r requirements/requirements.txt six==1.16.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # azure-core # bleach # html5lib @@ -245,59 +250,59 @@ six==1.16.0 # python-dateutil sniffio==1.3.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # anyio soupsieve==2.5 # via - # -r requirements.txt + # -r requirements/requirements.txt # beautifulsoup4 sqlparse==0.4.4 # via - # -r requirements.txt + # -r requirements/requirements.txt # django # django-debug-toolbar supervisor==4.2.5 - # via -r requirements.txt + # via -r requirements/requirements.txt telepath==0.3.1 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail text-unidecode==1.3 # via python-slugify typing-extensions==4.10.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # azure-core # azure-storage-blob # dj-database-url # pyee unittest-parametrize==1.4.0 - # via -r requirements-test.in + # via -r requirements/requirements-test.in urllib3==2.2.1 # via - # -r requirements.txt + # -r requirements/requirements.txt # django-anymail # requests # sentry-sdk wagtail==5.0.5 # via - # -r requirements.txt + # -r requirements/requirements.txt # puput # wagtail-markdown wagtail-markdown==0.11.0 # via - # -r requirements.txt + # -r requirements/requirements.txt # puput webencodings==0.5.1 # via - # -r requirements.txt + # -r requirements/requirements.txt # bleach # html5lib whitenoise==6.6.0 - # via -r requirements.txt + # via -r requirements/requirements.txt willow==1.6.3 # via - # -r requirements.txt + # -r requirements/requirements.txt # wagtail # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/requirements.in b/requirements/requirements.in index 81280adb..88df1e43 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -18,3 +18,4 @@ sentry-sdk[django] supervisor django-widget-tweaks dj-database-url +django-post_office diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 663b83e6..a1252525 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -17,7 +17,9 @@ azure-storage-blob==12.19.0 beautifulsoup4==4.11.2 # via wagtail bleach==4.1.0 - # via wagtail-markdown + # via + # django-post-office + # wagtail-markdown certifi==2023.11.17 # via # requests @@ -31,10 +33,10 @@ cryptography==41.0.7 defusedxml==0.7.1 # via willow dj-database-url==2.1.0 - # via -r requirements.in + # via -r requirements/requirements.in django==4.1.13 # via - # -r requirements.in + # -r requirements/requirements.in # dj-database-url # django-anymail # django-colorful @@ -44,6 +46,7 @@ django==4.1.13 # django-filter # django-modelcluster # django-permissionedforms + # django-post-office # django-recaptcha # django-storages # django-taggit @@ -54,37 +57,39 @@ django==4.1.13 # sentry-sdk # wagtail django-anymail==10.3 - # via -r requirements.in + # via -r requirements/requirements.in django-colorful==1.3 # via puput django-debug-toolbar==4.3.0 - # via -r requirements.in + # via -r requirements/requirements.in django-el-pagination==4.0.0 # via puput django-extensions==3.2.3 - # via -r requirements.in + # via -r requirements/requirements.in django-filter==22.1 # via wagtail django-modelcluster==6.2.1 # via wagtail django-permissionedforms==0.1 # via wagtail +django-post-office==3.8.0 + # via -r requirements/requirements.in django-recaptcha==4.0.0 - # via -r requirements.in + # via -r requirements/requirements.in django-social-share==2.3.0 # via puput django-storages==1.13.2 - # via -r requirements.in + # via -r requirements/requirements.in django-taggit==3.1.0 # via # puput # wagtail django-tailwind==3.8.0 - # via -r requirements.in + # via -r requirements/requirements.in django-treebeard==4.7 # via wagtail django-widget-tweaks==1.5.0 - # via -r requirements.in + # via -r requirements/requirements.in djangorestframework==3.14.0 # via wagtail draftjs-exporter==2.1.7 @@ -112,16 +117,17 @@ packaging==23.2 pillow==10.2.0 # via wagtail psycopg2-binary==2.9.9 - # via -r requirements.in + # via -r requirements/requirements.in puput==2.0.0 - # via -r requirements.in + # via -r requirements/requirements.in pycparser==2.21 # via cffi python-dotenv==1.0.1 - # via -r requirements.in + # via -r requirements/requirements.in pytz==2023.3.post1 # via # django-modelcluster + # django-post-office # djangorestframework # l18n requests==2.31.0 @@ -130,10 +136,10 @@ requests==2.31.0 # django-anymail # wagtail sentry-sdk==1.40.4 - # via -r requirements.in + # via -r requirements/requirements.in six==1.16.0 # via - # -r requirements.in + # -r requirements/requirements.in # azure-core # bleach # html5lib @@ -148,24 +154,24 @@ sqlparse==0.4.4 # django # django-debug-toolbar supervisor==4.2.5 - # via -r requirements.in + # via -r requirements/requirements.in telepath==0.3.1 # via wagtail typing-extensions==4.10.0 # via - # -r requirements.in + # -r requirements/requirements.in # azure-core # azure-storage-blob # dj-database-url urllib3==2.2.1 # via - # -r requirements.in + # -r requirements/requirements.in # django-anymail # requests # sentry-sdk wagtail==5.0.5 # via - # -r requirements.in + # -r requirements/requirements.in # puput # wagtail-markdown wagtail-markdown==0.11.0 @@ -175,7 +181,7 @@ webencodings==0.5.1 # bleach # html5lib whitenoise==6.6.0 - # via -r requirements.in + # via -r requirements/requirements.in willow==1.6.3 # via wagtail diff --git a/supervisord.conf b/supervisord.conf index 02d956dc..86941c09 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -3,3 +3,11 @@ nodaemon=false [program:foo] command=/bin/cat + +[program:post_office_send_queued_mail] +command=bash -c 'python /app/manage.py send_queued_mail && sleep 30' +autorestart=true + +[program:post_office_cleanup_mail] +command=bash -c 'python /app/manage.py python manage.py cleanup_mail --days=30 --delete-attachments && sleep 86400' +autorestart=true