What problem does it solve?
This Django integration enables PostHog analytics within Django apps by configuring server-side tracking, context enrichment, and reliable event capture without modifying existing business logic.
Core Features & Use Cases
- Automatic context-aware event tracking via PostHogContextMiddleware that attaches session and user context to events.
- Server-side initialization and configuration of PostHog in AppConfig using environment variables, ensuring consistent access across modules.
- User identification and property tagging on login/logout, plus event capture for key workflows such as login, dashboard access, and error scenarios.
- Feature flags, group analytics, and error tracking to drive product decisions and reliability.
- Lightweight reference and example files to guide integration and troubleshooting.
Quick Start
Configure POSTHOG_PROJECT_TOKEN and POSTHOG_HOST in your settings, add PosthogContextMiddleware to MIDDLEWARE, and verify a sample event captures correctly.