Event Tracking
raw JSON → 4.0.0 verified Mon Apr 27 auth: no python
A simple event tracking system for Python applications, commonly used in the Open edX platform. Current version 4.0.0, release cadence: irregular.
pip install event-tracking Common errors
error ModuleNotFoundError: No module named 'event_tracking' ↓
cause Using underscore instead of correct module name 'eventtracking'.
fix
pip install event-tracking, then use 'import eventtracking' (no underscore).
error django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: EventTrackingConfig ↓
cause Duplicate app config due to multiple installations or manual entry in INSTALLED_APPS.
fix
Ensure only one entry for 'eventtracking.django.EventTrackingConfig' in INSTALLED_APPS.
Warnings
breaking In v4.0.0, the Django integration requires explicitly adding 'eventtracking.django.EventTrackingConfig' to INSTALLED_APPS. Failure to do so causes AppRegistryNotReady errors. ↓
fix Add 'eventtracking.django.EventTrackingConfig' to INSTALLED_APPS in your Django settings.
gotcha The module name is 'eventtracking' (no underscore), not 'event_tracking'. Many users mistakenly use underscore-based imports. ↓
fix Use 'import eventtracking' or 'from eventtracking import ...'
deprecated Support for Python 3.8 was dropped in v3.0.0. Python 3.9+ required. ↓
fix Upgrade Python to 3.9 or higher.
Imports
- EventTrackingConfig wrong
from event_tracking.django import EventTrackingConfigcorrectfrom eventtracking.django import EventTrackingConfig - Tracker wrong
from eventtracking import trackercorrectfrom eventtracking import tracker as event_tracker
Quickstart
from eventtracking import tracker
tracker = tracker.get_tracker()
tracker.send({'name': 'my_event', 'data': {'key': 'value'}})
print('Event sent')