:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(admin): explain django admin vs posthog admin in the banner (#130423)
Julian Bez3ea7c4252ec1
diff --git a/posthog/admin/test_admin_console.py b/posthog/admin/test_admin_console.pyindex ac67f2d2ca38..4e7788ae9b94 100644--- a/posthog/admin/test_admin_console.py+++ b/posthog/admin/test_admin_console.py@@ -201,7 +201,7 @@ class TestAdminConsoleViews(BaseTest):assert response.status_code == 200content = response.content.decode()- assert "team actions moved to PostHog Admin" in content+ assert "This is the Django admin" in contentfor panel_key in ("remote-config", "email-sending", "ai-gateway", "api-token"):assert f"/admin/console/teams/{self.team.pk}/#panel-{panel_key}" in contentdiff --git a/posthog/templates/admin/base_site.html b/posthog/templates/admin/base_site.htmlindex 4c06a368a7ef..36bed0525870 100644--- a/posthog/templates/admin/base_site.html+++ b/posthog/templates/admin/base_site.html@@ -33,10 +33,6 @@}, 0);});- // Back/forward can restore this page from the bfcache with these controls still disabled,- // which leaves the operator on a page they cannot submit until they reload. A restore means- // the POST is done with. Only a control the handler above marked is released, so a control- // the template disabled on purpose stays disabled.var BANNER_KEY = "console-banner-hidden-until";document.addEventListener("DOMContentLoaded", function () {var banner = document.querySelector(".console-banner");@@ -62,6 +58,10 @@}});+ // Back/forward can restore this page from the bfcache with these controls still disabled,+ // which leaves the operator on a page they cannot submit until they reload. A restore means+ // the POST is done with. Only a control the handler above marked is released, so a control+ // the template disabled on purpose stays disabled.window.addEventListener("pageshow", function (event) {if (!event.persisted) {return;@@ -79,18 +79,17 @@.console-banner {display: flex;align-items: center;- gap: 14px;- padding: 8px 16px;- background: #fff4ec;- border-bottom: 2px solid #ff5c1c;- color: #3b2a1f;- font-size: 13px;+ flex-wrap: wrap;+ gap: 4px 12px;+ padding: 6px 16px;+ background: var(--darkened-bg);+ border-bottom: 1px solid var(--hairline-color);+ color: var(--body-quiet-color);+ font-size: 12px;line-height: 1.4;}- .console-banner img { width: 44px; height: auto; flex-shrink: 0; }- .console-banner p { margin: 0; padding: 0; }- .console-banner a.button { margin-left: auto; white-space: nowrap; }- .console-banner-hide { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; white-space: nowrap; }+ .console-banner p { margin: 0; padding: 0; font-size: inherit; }+ .console-banner-hide { margin-left: auto; padding: 0; background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; white-space: nowrap; font-size: inherit; }.console-banner[hidden] { display: none; }</style>{% if is_impersonated_session %}@@ -127,13 +126,10 @@{% endif %}{% if user.is_staff %}<div class="console-banner">- <img src="/static/admin-console/hoggies/desk-wizard.png" alt="" /><p>- <strong>Psst, team actions moved to PostHog Admin,</strong> where the buttons say what they do.- This Django admin keeps the raw tables.+ This is the Django admin, for viewing and editing core database tables directly. Staff tools are in PostHog Admin.+ <a href="{% block admin_console_url %}/admin/console/{% endblock %}">Open PostHog Admin</a></p>- <a class="button"- href="{% block admin_console_url %}/admin/console/{% endblock %}">Open PostHog Admin →</a><button type="button" class="console-banner-hide" data-hide-console-banner>Hide for a month</button></div>{% endif %}