Skip to content

Commit

Permalink
Merge pull request #2546 from ccnmtl/init-sentry
Browse files Browse the repository at this point in the history
Migrate to init_sentry
  • Loading branch information
nikolas authored Oct 8, 2024
2 parents 2269ff1 + fdc7486 commit a674ae2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
14 changes: 3 additions & 11 deletions plexus/settings_production.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import os
import sys
from django.conf import settings
from plexus.settings_shared import * # noqa: F403
from ctlsettings.production import common
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from ctlsettings.production import common, init_sentry

project = 'plexus'
base = os.path.dirname(__file__)
Expand All @@ -24,10 +21,5 @@
except ImportError:
pass

if ('migrate' not in sys.argv) and \
('collectstatic' not in sys.argv) and \
hasattr(settings, 'SENTRY_DSN'):
sentry_sdk.init(
dsn=SENTRY_DSN, # noqa: F405
integrations=[DjangoIntegration()],
)
if hasattr(settings, 'SENTRY_DSN'):
init_sentry(SENTRY_DSN) # noqa F405
15 changes: 3 additions & 12 deletions plexus/settings_staging.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import os
import sys
from django.conf import settings
from plexus.settings_shared import * # noqa: F403
from ctlsettings.staging import common
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from ctlsettings.staging import common, init_sentry

project = 'plexus'
base = os.path.dirname(__file__)
Expand All @@ -24,11 +21,5 @@
except ImportError:
pass

if ('migrate' not in sys.argv) and \
('collectstatic' not in sys.argv) and \
hasattr(settings, 'SENTRY_DSN'):
sentry_sdk.init(
dsn=SENTRY_DSN, # noqa: F405
integrations=[DjangoIntegration()],
debug=True,
)
if hasattr(settings, 'SENTRY_DSN'):
init_sentry(SENTRY_DSN) # noqa F405
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ beautifulsoup4==4.12.0

html5lib==1.1

ctlsettings==0.3.3
ctlsettings==0.3.4

pbr==6.1.0
PyYAML>=3.10.0 # MIT
Expand Down

0 comments on commit a674ae2

Please sign in to comment.