Skip to content

Commit 204db44

Browse files
committed
chore: make django API surface smaller
1 parent 8b2a727 commit 204db44

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

sentry_sdk/integrations/django/__init__.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ def _got_request_exception(request=None, **kwargs):
5656
_installed = False
5757

5858

59-
def initialize():
59+
def _install():
6060
global _installed
6161
with _installer_lock:
6262
if _installed:
6363
return
64-
_initialize_impl()
64+
_install_impl()
6565
_installed = True
6666

6767

68-
def _initialize_impl():
68+
def _install_impl():
6969
# default settings.MIDDLEWARE is None
7070
if getattr(settings, 'MIDDLEWARE', None):
7171
middleware_attr = 'MIDDLEWARE'
@@ -87,20 +87,18 @@ def _initialize_impl():
8787
signals.got_request_exception.connect(_got_request_exception)
8888

8989

90-
91-
9290
try:
9391
# Django >= 1.7
9492
from django.apps import AppConfig
9593
except ImportError:
96-
initialize()
94+
_install()
9795
else:
9896
class SentryConfig(AppConfig):
9997
name = 'sentry_sdk.integrations.django'
10098
label = 'sentry_sdk_integrations_django'
10199
verbose_name = 'Sentry'
102100

103101
def ready(self):
104-
initialize()
102+
_install()
105103

106104
default_app_config = 'sentry_sdk.integrations.django.SentryConfig'

0 commit comments

Comments
 (0)