You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2f0d67d
Browse filesBrowse the repository at this point in the historyBrowse files
Align ASGI, Flask, and Django request integration configuration. ASGI and Flask now default to inheriting the effective client's exception-autocapture setting, with explicit capture overrides and context-only operation. Flask and Django require opt-in to accept PostHog tracing identity/session headers. Django adds property-named settings and extraction methods while preserving legacy aliases and its historical capture default; setting POSTHOG_MW_CAPTURE_EXCEPTIONS to None enables client inheritance. Document client routing, request-filter semantics, and event enrichment independently of error tracking.
-[Request integration configuration](references/middleware_configuration.md) — shared middleware options and compatibility notes
30
31
-[OpenFeature provider docs](https://posthog.com/docs/feature-flags/installation/openfeature) — use PostHog flags through the [OpenFeature](https://openfeature.dev) Python SDK
@@ -69,18 +69,26 @@ class PosthogContextMiddleware:
69
69
- Forwarded IP address as `$ip`
70
70
- User agent as `$user_agent`
71
71
72
-
The context will also auto-capture exceptions and send them to PostHog, unless you disable it by setting
73
-
`POSTHOG_MW_CAPTURE_EXCEPTIONS` to `False` in your Django settings. The exceptions are captured using the
74
-
global client, unless the setting `POSTHOG_MW_CLIENT` is set to a custom client instance
75
-
76
-
The middleware behaviour is customisable through 3 additional functions:
77
-
- `POSTHOG_MW_EXTRA_TAGS`, which is a Callable[[HttpRequest], Dict[str, Any]] expected to return a dictionary of additional tags to be added to the context.
78
-
- `POSTHOG_MW_REQUEST_FILTER`, which is a Callable[[HttpRequest], bool] expected to return `False` if the request should not be tracked.
79
-
- `POSTHOG_MW_TAG_MAP`, which is a Callable[[Dict[str, Any]], Dict[str, Any]], which you can use to modify the tags before they're added to the context.
80
-
81
-
You can use the `POSTHOG_MW_TAG_MAP` function to remove any default tags you don't want to capture, or override them with your own values.
82
-
83
-
Context tags are automatically included as properties on all events captured within a context, including exceptions.
72
+
Configure the integration with these Django settings:
73
+
- `POSTHOG_MW_CLIENT`: client used for automatic exception capture, or the global client.
74
+
This does not redirect events explicitly captured through other clients.
0 commit comments