[CI] (e2f7ab0) django/django3-saas#2421
Closed
wizard-ci-bot[bot] wants to merge 1 commit into
Closed
Conversation
Author
PR Evaluation ReportSummaryThis PR integrates PostHog into a Django SaaS application by adding the Python SDK to
Confidence score: 4/5 👍
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | Yes | No syntax errors; all imports valid |
| Preserves existing env vars & configs | Yes | All existing settings and code preserved |
| No syntax or type errors | Yes | All added code is syntactically correct |
| Correct imports/exports | Yes | from posthog import new_context, identify_context, tag, capture are valid module-level imports |
| Minimal, focused changes | Yes | Only PostHog-related additions |
| Pre-existing issues | None | — |
Issues
.env.examplenot updated:POSTHOG_PROJECT_TOKENandPOSTHOG_HOSTare added tosettings.pybut not documented in.env.example. Collaborators won't know to set these variables. [MEDIUM]
Other completed criteria
- All changes are relevant to PostHog integration
- Correct files modified for Django framework
- Code follows existing codebase patterns (indentation, style)
- Build configuration (requirements.txt) is valid
PostHog implementation ⚠️
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog added to requirements.txt |
| PostHog client initialized | No | Uses deprecated module-level posthog.api_key / posthog.host pattern in AppConfig.ready() instead of Posthog() class constructor. Missing enable_exception_autocapture=True and atexit.register(posthog.shutdown) |
| capture() | Yes | 13 meaningful events across accounts, billing, and dashboard views |
| identify() | N/A | Server-only app |
| Error tracking | No | PosthogContextMiddleware captures view exceptions by default, but enable_exception_autocapture=True is not configured on the client, so exceptions outside the request/response cycle are not tracked |
| Reverse proxy | N/A | Server-only app |
Issues
- Module-level initialization pattern: The PR uses
posthog.api_key = settings.POSTHOG_PROJECT_TOKENinstead ofposthog = Posthog(settings.POSTHOG_PROJECT_TOKEN, host=settings.POSTHOG_HOST, enable_exception_autocapture=True). The instance-based constructor is the recommended pattern and is required to enable exception autocapture and other constructor-only options. [CRITICAL] - Missing
atexit.register(posthog.shutdown): Without registering shutdown, queued events may be lost on process exit. Should addimport atexit; atexit.register(posthog.shutdown)inAppConfig.ready(). [MEDIUM]
Other completed criteria
- API key loaded from environment variable via
os.environ.get('POSTHOG_PROJECT_TOKEN') - Host correctly configured with default
https://us.i.posthog.com PosthogContextMiddlewarecorrectly placed afterAuthenticationMiddleware- Context API properly used with
new_context(),identify_context(), andcapture() - Users identified by
str(user.pk)— correct for Django
PostHog insights and events ⚠️
| Filename | PostHog events | Description |
|---|---|---|
accounts/views.py |
user_logged_in, user_logged_out, user_registered, profile_updated |
Full auth lifecycle; login includes login_method, register includes has_company_name |
billing/views.py |
pricing_viewed, subscription_started, subscription_changed, subscription_canceled, checkout_completed, payment_failed |
Complete billing funnel from pricing page through subscription lifecycle |
dashboard/views.py |
project_created, project_updated, project_deleted |
Project CRUD events (no properties attached) |
Issues
- PII in event properties via
tag():tag('username', user.username)in login and registration views injects the username into event properties. PII should be set as person properties via/in capture calls, not as event-level tags. [MEDIUM] - Project events lack properties:
project_created,project_updated, andproject_deletedare captured with no properties — no project name, type, or count. This limits analytical usefulness. [LOW]
Other completed criteria
- Events represent real user actions mapping to actual product flows
- Events enable product insights — pricing_viewed → subscription_started forms a clear conversion funnel; subscription lifecycle enables churn analysis
- Billing events include relevant properties (plan_name, plan_interval, plan_price, days_remaining)
- Event names follow consistent snake_case convention with descriptive
[noun]_[verb]pattern
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:
e2f7ab0App:
django/django3-saasApp directory:
apps/django/django3-saasWorkbench branch:
wizard-ci-e2f7ab0-django-django3-saasWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-07-06T22:00:32.480Z
Duration: 488.4s
YARA Scanner