Repository navigation
[CI] (3f39e0e) django/django3-saas - #4153
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
|
Now I have all the context I need. Let me produce the evaluation. PR Evaluation ReportSummaryThis PR integrates PostHog into a Django SaaS application by adding the Python SDK, initializing it via
Confidence score: 3/5 🤔
File changes
App sanity check
|
| Criteria | Result | Description |
|---|---|---|
| App builds and runs | No | RuntimeError in settings.py crashes the app in DEBUG mode if PostHog env vars are missing |
| Preserves existing env vars & configs | No | Existing dev environments without PostHog env vars will crash on startup |
| No syntax or type errors | Yes | All syntax is valid |
| Correct imports/exports | Yes | All imports are correct — posthog, identify_context, Posthog from correct packages |
| Minimal, focused changes | No | OTel log exporter adds 2 dependencies and ~30 lines beyond core PostHog integration |
| Pre-existing issues | None | — |
Issues
- RuntimeError breaks existing dev setups:
settings.pyraisesRuntimeErrorduring module load ifPOSTHOG_PROJECT_TOKENorPOSTHOG_HOSTare empty andDEBUG=True. This crashes the app before it can start. Replace withlogging.warning()or remove the check — theAppConfig.ready()already has a guard clause that skips initialization when tokens are missing. [CRITICAL] - OTel log exporter is unnecessary scope creep: The
_configure_posthog_log_capturemethod, OTel dependencies, andposthog_loggerusage indashboard/views.pygo beyond the core PostHog SDK integration. This adds two heavy dependencies (opentelemetry-sdk,opentelemetry-exporter-otlp-proto-http) that are not needed for analytics, error tracking, or event capture. [MEDIUM]
Other completed criteria
- Environment variables documented in
.env.example - Build configuration (requirements.txt) is parseable
PostHog implementation ✅
| Criteria | Result | Description |
|---|---|---|
| PostHog SDKs installed | Yes | posthog added to requirements.txt |
| PostHog client initialized | Yes | Posthog() constructor in ConfigConfig.ready() with enable_exception_autocapture=True, set as posthog.default_client, with atexit.register(posthog_client.shutdown) |
| capture() | Yes | 13 meaningful capture calls across accounts, billing, and dashboard views |
| identify() | N/A | Server-only app |
| Error tracking | Yes | enable_exception_autocapture=True in constructor + PosthogContextMiddleware captures exceptions |
| Reverse proxy | N/A | Server-only app |
Issues
No PostHog implementation issues.
Other completed criteria
- API key loaded from
os.environ.get('POSTHOG_PROJECT_TOKEN')— not hardcoded - Host loaded from
os.environ.get('POSTHOG_HOST')— correctly configured PosthogContextMiddlewareplaced afterAuthenticationMiddleware— correct ordering per docsuser_logged_insignal correctly callsidentify_context(str(user.pk))to fix login request context per Django docsposthog.set()correctly used for person properties (Python SDK's equivalent of identify)atexit.register(posthog_client.shutdown)ensures events flush on exit
PostHog insights and events ✅
| Filename | PostHog events | Description |
|---|---|---|
accounts/views.py |
user_logged_in, user_logged_out, user_registered, account_settings_updated |
Auth lifecycle and profile management events |
accounts/models.py |
Person properties via posthog.set() |
Sets email, username, name, company on login signal |
billing/views.py |
subscription_checkout_started, subscription_started, subscription_plan_changed, subscription_canceled, subscription_activated, subscription_payment_failed |
Full billing funnel coverage with plan metadata |
dashboard/views.py |
project_created, project_updated, project_deleted |
CRUD events for core project entity |
Issues
No event quality issues.
Other completed criteria
- Events represent real user actions (registration, login, subscription, project CRUD)
- Events enable product insights — full signup → subscribe → use funnel possible
- Events include relevant properties (
plan_slug,plan_interval,billing_mode,has_company_name,updated_fields,is_active) - No PII in capture() properties — email/name only set via
posthog.set()(person property method) - Event names are descriptive, 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:
3f39e0eApp:
django/django3-saasApp directory:
apps/django/django3-saasWorkbench branch:
wizard-ci-3f39e0e-django-django3-saasWizard branch:
release-please--branches--main--components--wizardContext Mill branch:
mainPostHog (MCP) branch:
masterTimestamp: 2026-09-23T21:53:36.028Z
Duration: 498.2s
YARA Scanner