From 85a4fdbaa909c7642042a70c7ab005225bb4d816 Mon Sep 17 00:00:00 2001 From: kl Date: Tue, 11 Jul 2023 00:38:09 +0800 Subject: [PATCH] fix(django_admin): Disable django_admin on prod (#52329) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disable django_admin on prod ,fix #23742 , https://github.com/getsentry/self-hosted/issues/1039 cc @BYK ### Legal Boilerplate Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. --- src/sentry/conf/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentry/conf/urls.py b/src/sentry/conf/urls.py index 15d3c3af373784..6053b9ec144d7a 100644 --- a/src/sentry/conf/urls.py +++ b/src/sentry/conf/urls.py @@ -29,7 +29,7 @@ ), ] -if "django.contrib.admin" in settings.INSTALLED_APPS: +if "django.contrib.admin" in settings.INSTALLED_APPS and settings.ADMIN_ENABLED: from sentry import django_admin urlpatterns += django_admin.urlpatterns