diff options
author | Matthew Lemon <y@yulqen.org> | 2024-12-08 21:18:23 +0000 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-12-08 21:18:23 +0000 |
commit | d3dda8c0bd194c28cf11c189c150c00bdc3e8a83 (patch) | |
tree | 28a656ea58e1420cc0da024eeadcc6ff1b30f234 /config | |
parent | 411e79ada3d5bf315000ff5bb598235118d50b51 (diff) |
wip: working on ratelimit - not quite working in the browser
Diffstat (limited to 'config')
-rw-r--r-- | config/settings/base.py | 7 | ||||
-rw-r--r-- | config/settings/local.py | 12 | ||||
-rw-r--r-- | config/settings/production.py | 3 |
3 files changed, 16 insertions, 6 deletions
diff --git a/config/settings/base.py b/config/settings/base.py index 9c6183c..157926b 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -359,3 +359,10 @@ AWS_S3_ENDPOINT_URL = env("SPACES_ENDPOINT_URL") MAILGUN_API_KEY = env("MAILGUN_API_KEY") MAILGUN_SENDER_DOMAIN = env("MAILGUN_SENDER_DOMAIN") MAILGUN_API_URL = env("MAILGUN_API_URL", default="https://api.eu.mailgun.net/v3") + +CACHES = { + "default": { + "BACKEND": "django.core.cache.backends.db.DatabaseCache", + "LOCATION": "rate_limit_cache", + }, +} diff --git a/config/settings/local.py b/config/settings/local.py index b9eb50b..e95cbb9 100644 --- a/config/settings/local.py +++ b/config/settings/local.py @@ -19,12 +19,12 @@ ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1"] # noqa: S104 # CACHES # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#caches -CACHES = { - "default": { - "BACKEND": "django.core.cache.backends.locmem.LocMemCache", - "LOCATION": "", - }, -} +# CACHES = { +# "default": { +# "BACKEND": "django.core.cache.backends.locmem.LocMemCache", +# "LOCATION": "", +# }, +# } # EMAIL # ------------------------------------------------------------------------------ diff --git a/config/settings/production.py b/config/settings/production.py index cfd7d78..374be33 100644 --- a/config/settings/production.py +++ b/config/settings/production.py @@ -230,3 +230,6 @@ LOGGING = { MAILGUN_API_KEY = env("MAILGUN_API_KEY") MAILGUN_SENDER_DOMAIN = env("MAILGUN_DOMAIN") MAILGUN_API_URL = env("MAILGUN_API_URL", default="https://api.eu.mailgun.net/v3") + +USE_X_FORWARDED_HOST = True +SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") |