aboutsummaryrefslogtreecommitdiffstats
path: root/config/settings/base.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-05-27 20:56:03 +0100
committerMatthew Lemon <y@yulqen.org>2024-05-27 20:56:03 +0100
commit271bc7c662ab59f562be01470e9b4fafed107a90 (patch)
tree7b825a1011666af43e2b71b1f5c528d9750f3a37 /config/settings/base.py
parent0ec7b9c700c820ddd3b90f060af42000a60178cc (diff)
Removes most celery, storages and sentry config
Comments out in the settings files. Leaves a couple of imports of celery, but we're not removing the requirements on celery so should be fine, it will be installed. Comments out storages and sentry code. Leaves it all in Dockerfile and compose, but this change is aimed at getting Django running WITHOUT docker and compose.
Diffstat (limited to 'config/settings/base.py')
-rw-r--r--config/settings/base.py125
1 files changed, 63 insertions, 62 deletions
diff --git a/config/settings/base.py b/config/settings/base.py
index def232c..9414953 100644
--- a/config/settings/base.py
+++ b/config/settings/base.py
@@ -260,38 +260,39 @@ LOGGING = {
# Celery
# ------------------------------------------------------------------------------
-if USE_TZ:
- # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-timezone
- CELERY_TIMEZONE = TIME_ZONE
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-broker_url
-CELERY_BROKER_URL = env("CELERY_BROKER_URL")
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-result_backend
-CELERY_RESULT_BACKEND = CELERY_BROKER_URL
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-extended
-CELERY_RESULT_EXTENDED = True
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-backend-always-retry
-# https://github.com/celery/celery/pull/6122
-CELERY_RESULT_BACKEND_ALWAYS_RETRY = True
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-backend-max-retries
-CELERY_RESULT_BACKEND_MAX_RETRIES = 10
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-accept_content
-CELERY_ACCEPT_CONTENT = ["json"]
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-task_serializer
-CELERY_TASK_SERIALIZER = "json"
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-result_serializer
-CELERY_RESULT_SERIALIZER = "json"
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#task-time-limit
-# TODO: set to whatever value is adequate in your circumstances
-CELERY_TASK_TIME_LIMIT = 5 * 60
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#task-soft-time-limit
-# TODO: set to whatever value is adequate in your circumstances
-CELERY_TASK_SOFT_TIME_LIMIT = 60
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#beat-scheduler
-CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler"
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#worker-send-task-events
-CELERY_WORKER_SEND_TASK_EVENTS = True
-# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std-setting-task_send_sent_event
-CELERY_TASK_SEND_SENT_EVENT = True
+# if USE_TZ:
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-timezone
+# CELERY_TIMEZONE = TIME_ZONE
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-broker_url
+# CELERY_BROKER_URL = env("CELERY_BROKER_URL")
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-result_backend
+# CELERY_RESULT_BACKEND = CELERY_BROKER_URL
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-extended
+# CELERY_RESULT_EXTENDED = True
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-backend-always-retry
+# # https://github.com/celery/celery/pull/6122
+# CELERY_RESULT_BACKEND_ALWAYS_RETRY = True
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-backend-max-retries
+# CELERY_RESULT_BACKEND_MAX_RETRIES = 10
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-accept_content
+# CELERY_ACCEPT_CONTENT = ["json"]
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-task_serializer
+# CELERY_TASK_SERIALIZER = "json"
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-result_serializer
+# CELERY_RESULT_SERIALIZER = "json"
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#task-time-limit
+# # TODO: set to whatever value is adequate in your circumstances
+# CELERY_TASK_TIME_LIMIT = 5 * 60
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#task-soft-time-limit
+# # TODO: set to whatever value is adequate in your circumstances
+# CELERY_TASK_SOFT_TIME_LIMIT = 60
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#beat-scheduler
+# CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler"
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#worker-send-task-events
+# CELERY_WORKER_SEND_TASK_EVENTS = True
+# # https://docs.celeryq.dev/en/stable/userguide/configuration.html#std-setting-task_send_sent_event
+# CELERY_TASK_SEND_SENT_EVENT = True
+
# django-allauth
# ------------------------------------------------------------------------------
ACCOUNT_ALLOW_REGISTRATION = env.bool("DJANGO_ACCOUNT_ALLOW_REGISTRATION", True)
@@ -316,36 +317,36 @@ SOCIALACCOUNT_FORMS = {"signup": "pyblackbird_cc.users.forms.UserSocialSignupFor
# STORAGES
# ------------------------------------------------------------------------------
-# https://django-storages.readthedocs.io/en/latest/#installation
-INSTALLED_APPS += ["storages"]
-# https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
-# AWS_ACCESS_KEY_ID = env("DJANGO_AWS_ACCESS_KEY_ID")
-AWS_ACCESS_KEY_ID = env("SPACES_KEY")
-# https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
-# AWS_SECRET_ACCESS_KEY = env("DJANGO_AWS_SECRET_ACCESS_KEY")
-AWS_SECRET_ACCESS_KEY = env("SPACES_SECRET")
-# https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
-# AWS_STORAGE_BUCKET_NAME = env("DJANGO_AWS_STORAGE_BUCKET_NAME")
-AWS_STORAGE_BUCKET_NAME = env("SPACES_BUCKET_NAME")
-# https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
-AWS_QUERYSTRING_AUTH = False
-# DO NOT change these unless you know what you're doing.
-_AWS_EXPIRY = 60 * 60 * 24 * 7
-# https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
-AWS_S3_OBJECT_PARAMETERS = {
- "CacheControl": f"max-age={_AWS_EXPIRY}, s-maxage={_AWS_EXPIRY}, must-revalidate",
-}
-# https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
-AWS_S3_MAX_MEMORY_SIZE = env.int(
- "DJANGO_AWS_S3_MAX_MEMORY_SIZE",
- default=100_000_000, # 100MB
-)
-# https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
-AWS_S3_REGION_NAME = env("DJANGO_AWS_S3_REGION_NAME", default=None)
-# https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#cloudfront
-AWS_S3_CUSTOM_DOMAIN = env("DJANGO_AWS_S3_CUSTOM_DOMAIN", default=None)
-aws_s3_domain = AWS_S3_CUSTOM_DOMAIN or f"{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com"
-AWS_S3_ENDPOINT_URL = env("SPACES_ENDPOINT_URL")
+# # https://django-storages.readthedocs.io/en/latest/#installation
+# INSTALLED_APPS += ["storages"]
+# # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
+# # AWS_ACCESS_KEY_ID = env("DJANGO_AWS_ACCESS_KEY_ID")
+# AWS_ACCESS_KEY_ID = env("SPACES_KEY")
+# # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
+# # AWS_SECRET_ACCESS_KEY = env("DJANGO_AWS_SECRET_ACCESS_KEY")
+# AWS_SECRET_ACCESS_KEY = env("SPACES_SECRET")
+# # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
+# # AWS_STORAGE_BUCKET_NAME = env("DJANGO_AWS_STORAGE_BUCKET_NAME")
+# AWS_STORAGE_BUCKET_NAME = env("SPACES_BUCKET_NAME")
+# # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
+# AWS_QUERYSTRING_AUTH = False
+# # DO NOT change these unless you know what you're doing.
+# _AWS_EXPIRY = 60 * 60 * 24 * 7
+# # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
+# AWS_S3_OBJECT_PARAMETERS = {
+# "CacheControl": f"max-age={_AWS_EXPIRY}, s-maxage={_AWS_EXPIRY}, must-revalidate",
+# }
+# # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
+# AWS_S3_MAX_MEMORY_SIZE = env.int(
+# "DJANGO_AWS_S3_MAX_MEMORY_SIZE",
+# default=100_000_000, # 100MB
+# )
+# # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
+# AWS_S3_REGION_NAME = env("DJANGO_AWS_S3_REGION_NAME", default=None)
+# # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#cloudfront
+# AWS_S3_CUSTOM_DOMAIN = env("DJANGO_AWS_S3_CUSTOM_DOMAIN", default=None)
+# aws_s3_domain = AWS_S3_CUSTOM_DOMAIN or f"{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com"
+# AWS_S3_ENDPOINT_URL = env("SPACES_ENDPOINT_URL")
# Your stuff...
# ------------------------------------------------------------------------------