From 9ada4c860e8a50bbce6623423a7d0641f58b2202 Mon Sep 17 00:00:00 2001 From: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com> Date: Tue, 14 Nov 2023 10:25:00 +1100 Subject: [PATCH] Configure the number of proxies to fix anon rate limiting (#3344) * Configure the number of proxies to fix anon rate limiting * Update api/conf/settings/rest_framework.py --- api/conf/settings/rest_framework.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/conf/settings/rest_framework.py b/api/conf/settings/rest_framework.py index b994d45c197..17f305043c7 100644 --- a/api/conf/settings/rest_framework.py +++ b/api/conf/settings/rest_framework.py @@ -57,3 +57,7 @@ **{k: None for k, _ in REST_FRAMEWORK["DEFAULT_THROTTLE_RATES"].items()} ) del REST_FRAMEWORK["DEFAULT_THROTTLE_CLASSES"] + +# https://www.django-rest-framework.org/api-guide/throttling/#how-clients-are-identified +# We override this in live environments to an appropriate number based on our deployment +NUM_PROXIES = config("NUM_PROXIES", default=0, cast=int)