Skip to content

Commit

Permalink
Put NUM_PROXIES setting in correct location for DRF (#3398)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarayourfriend authored Nov 27, 2023
1 parent 0e470b2 commit f96a1ae
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions api/conf/settings/rest_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
},
"EXCEPTION_HANDLER": "api.utils.exceptions.exception_handler",
"DEFAULT_SCHEMA_CLASS": "api.docs.base_docs.MediaSchema",
# https://www.django-rest-framework.org/api-guide/throttling/#how-clients-are-identified
# Live environments should configure this to an appropriate number
"NUM_PROXIES": config("NUM_PROXIES", default=0, cast=int),
}

if config("DISABLE_GLOBAL_THROTTLING", default=True, cast=bool):
Expand All @@ -57,7 +60,3 @@
**{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)

0 comments on commit f96a1ae

Please sign in to comment.