Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 6.1.1 - 2025-07-16

- fix: correctly capture exceptions processed by Django from views or middleware

# 6.1.0 - 2025-07-10

- feat: decouple feature flag local evaluation from personal API keys; support decrypting remote config payloads without relying on the feature flags poller
Expand All @@ -21,12 +25,14 @@
# 6.0.0

This release contains a number of major breaking changes:

- feat: make distinct_id an optional parameter in posthog.capture and related functions
- feat: make capture and related functions return `Optional[str]`, which is the UUID of the sent event, if it was sent
- fix: remove `identify` (prefer `posthog.set()`), and `page` and `screen` (prefer `posthog.capture()`)
- fix: delete exception-capture specific integrations module. Prefer the general-purpose django middleware as a replacement for the django `Integration`.

To migrate to this version, you'll mostly just need to switch to using named keyword arguments, rather than positional ones. For example:

```python
# Old calling convention
posthog.capture("user123", "button_clicked", {"button_id": "123"})
Expand Down
14 changes: 13 additions & 1 deletion posthog/integrations/django.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import TYPE_CHECKING, cast
from posthog import contexts
from posthog import contexts, capture_exception
from posthog.client import Client

if TYPE_CHECKING:
Expand Down Expand Up @@ -167,3 +167,15 @@ def __call__(self, request):
contexts.tag(k, v)

return self.get_response(request)

def process_exception(self, request, exception):
if self.request_filter and not self.request_filter(request):
return

if not self.capture_exceptions:
return

if self.client:
self.client.capture_exception(exception)
else:
capture_exception(exception)
2 changes: 1 addition & 1 deletion posthog/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "6.1.0"
VERSION = "6.1.1"

if __name__ == "__main__":
print(VERSION, end="") # noqa: T201
14 changes: 12 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading