From b74a9cffb654185800f666fbc129bbcfefb78d6d Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Tue, 25 Aug 2026 13:17:39 -0400 Subject: [PATCH] docs(python): Document `failed_request_status_codes` option for Django Add an `` entry for `failed_request_status_codes` to the Django integration page, matching the existing docs for this option in the FastAPI, Starlette, aiohttp, litestar, and bottle integrations. Related to changes introduced in https://github.com/getsentry/sentry-python/pull/7140/ --- .../python/integrations/django/index.mdx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/platforms/python/integrations/django/index.mdx b/docs/platforms/python/integrations/django/index.mdx index 2644651231f39..14e20a608cba7 100644 --- a/docs/platforms/python/integrations/django/index.mdx +++ b/docs/platforms/python/integrations/django/index.mdx @@ -249,6 +249,24 @@ Note that `OPTIONS` and `HEAD` are excluded by default. + + +A set of integers that will determine which status codes should be reported to Sentry. + +The `failed_request_status_codes` option determines whether exceptions handled within Django should be + reported to Sentry. Unhandled exceptions that don't have a `status_code` attribute will always be reported to Sentry. + +Examples of valid `failed_request_status_codes`: + - `{500}` will only send events on HTTP 500. + - `{400, *range(500, 600)}` will send events on HTTP 400 as well as the 5xx range. + - `{500, 503}` will send events on HTTP 500 and 503. + - `set()` (the empty set) will not send events for any HTTP status code. + +The default is `{*range(500, 600)}`, meaning that all 5xx status codes are reported to Sentry. + + + + ## Next Steps