Repository navigation
[CI] (38ef7e6) django/django3-saas - #2588
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
wizard-ci-bot[bot] wants to merge 1 commit into
Conversation
Author
PR Evaluation ReportSummaryThis PR integrates PostHog into a Django 3 SaaS application by adding the Python SDK, initializing it in
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors, valid imports, dependency added |
| Preserves existing env vars & configs | Yes | Existing settings preserved, only PostHog additions made |
| No syntax or type errors | Yes | All code is syntactically correct |
| Correct imports/exports | Yes | All imports from posthog are valid module-level functions |
| Minimal, focused changes | Yes | Only PostHog-related changes, no unrelated modifications |
| Pre-existing issues | None | N/A |
Issues
- No .env.example documentation:
POSTHOG_PROJECT_TOKENandPOSTHOG_HOSTare not documented in.env.exampleor equivalent file for collaborators. The report mentions.envwas created but it's not committed. [MEDIUM]
Other completed criteria
- Build configuration is valid —
posthogadded torequirements.txt INSTALLED_APPScorrectly updated from'accounts'to'accounts.apps.AccountsConfig'- Middleware placed after
AuthenticationMiddlewareas recommended
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog added to requirements.txt |
| PostHog client initialized | Yes | Initialized in AccountsConfig.ready() with API key and host from env vars, atexit shutdown registered |
| capture() | Yes | 12 meaningful capture calls across accounts, billing, and dashboard views |
| identify() | N/A | Server-only Django app |
| Error tracking | No | No enable_exception_autocapture=True configured. The module-level init (posthog.api_key = ...) doesn't support this parameter — requires instance-based Posthog() constructor |
| Reverse proxy | N/A | Server-only app |
Issues
- Module-level init prevents exception autocapture: The PR uses
posthog.api_key = settings.POSTHOG_PROJECT_TOKENmodule-level configuration. Theenable_exception_autocapture=Trueparameter is only available on thePosthog()class constructor. While thePosthogContextMiddlewarecaptures view exceptions by default, uncaught exceptions outside of request handling won't be auto-captured. Should useposthog = Posthog(api_key, host=host, enable_exception_autocapture=True)instead. [MEDIUM]
Other completed criteria
- API key loaded from
POSTHOG_PROJECT_TOKENenvironment variable, not hardcoded - Host correctly configured with sensible default
https://us.i.posthog.com PosthogContextMiddlewareadded toMIDDLEWAREfor automatic request contextatexit.register(posthog.shutdown)ensures events are flushed on exit- Context API used correctly with
new_context()+identify_context()pattern distinct_idvalues come fromrequest.user.id(real auth context)
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
accounts/views.py |
user_logged_in, user_logged_out, user_registered, profile_updated |
Core auth lifecycle events with login method and registration properties |
billing/views.py |
checkout_initiated, subscription_started, checkout_completed, subscription_plan_changed, subscription_canceled |
Full billing funnel: initiation → completion → changes → cancellation with plan details |
dashboard/views.py |
project_created, project_updated, project_deleted |
Project CRUD lifecycle tracking |
Issues
No issues.
Other completed criteria
- Events represent real user actions mapping to actual product flows (auth, billing, project management)
- Events enable product insights — supports registration→subscription funnel, churn analysis, project activity trends
- Events include relevant properties (plan_slug, plan_interval, demo_mode, login_method, etc.)
- No PII in event properties —
usernameandis_staffare set viatag()(context mechanism), not in capture properties - Event names are descriptive and use consistent snake_case convention
Reviewed by wizard workbench PR evaluator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated wizard CI run
Source: wizard-pr
Trigger ID:
38ef7e6App:
django/django3-saasApp directory:
apps/django/django3-saasWorkbench branch:
wizard-ci-38ef7e6-django-django3-saasWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-07-09T19:06:57.717Z
Duration: 491.9s
YARA Scanner