diff options
author | Matthew Lemon <y@yulqen.org> | 2024-05-28 15:15:44 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-05-28 15:15:44 +0100 |
commit | 2037c6b87564772c7ac3f3ece3e4b2df5bc44cdc (patch) | |
tree | 222bb552655033468af47818a072096999cd03d9 /config/settings | |
parent | 2b4181aecadbbad988cd80f97ef71b42d47a3cb1 (diff) |
Should be a buildable Django container
Diffstat (limited to 'config/settings')
-rw-r--r-- | config/settings/base.py | 60 | ||||
-rw-r--r-- | config/settings/local-bak.py (renamed from config/settings/local.py) | 1 | ||||
-rw-r--r-- | config/settings/production.py | 15 |
3 files changed, 37 insertions, 39 deletions
diff --git a/config/settings/base.py b/config/settings/base.py index 9414953..09a748f 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -317,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("STATIC_ENDPOINT_URL") # Your stuff... # ------------------------------------------------------------------------------ diff --git a/config/settings/local.py b/config/settings/local-bak.py index 8abae6f..afcdb3f 100644 --- a/config/settings/local.py +++ b/config/settings/local-bak.py @@ -1,6 +1,5 @@ # ruff: noqa: E501 from .base import * # noqa: F403 -from .base import INSTALLED_APPS from .base import env # GENERAL diff --git a/config/settings/production.py b/config/settings/production.py index 63afa6d..1c04152 100644 --- a/config/settings/production.py +++ b/config/settings/production.py @@ -3,7 +3,6 @@ from .base import * # noqa: F403 from .base import DATABASES -from .base import INSTALLED_APPS from .base import env # GENERAL @@ -124,16 +123,16 @@ ADMIN_URL = env("DJANGO_ADMIN_URL") # Anymail # ------------------------------------------------------------------------------ # https://anymail.readthedocs.io/en/stable/installation/#installing-anymail -INSTALLED_APPS += ["anymail"] +#INSTALLED_APPS += ["anymail"] # https://docs.djangoproject.com/en/dev/ref/settings/#email-backend # https://anymail.readthedocs.io/en/stable/installation/#anymail-settings-reference # https://anymail.readthedocs.io/en/stable/esps/mailgun/ -EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend" -ANYMAIL = { - "MAILGUN_API_KEY": env("MAILGUN_API_KEY"), - "MAILGUN_SENDER_DOMAIN": env("MAILGUN_DOMAIN"), - "MAILGUN_API_URL": env("MAILGUN_API_URL", default="https://api.mailgun.net/v3"), -} +# EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend" +# ANYMAIL = { +# "MAILGUN_API_KEY": env("MAILGUN_API_KEY"), +# "MAILGUN_SENDER_DOMAIN": env("MAILGUN_DOMAIN"), +# "MAILGUN_API_URL": env("MAILGUN_API_URL", default="https://api.mailgun.net/v3"), +#} # LOGGING |