diff --git a/backend/maguire/settings.py b/backend/maguire/settings.py index 2cc84c6..58a0211 100644 --- a/backend/maguire/settings.py +++ b/backend/maguire/settings.py @@ -12,7 +12,7 @@ import os import json - +import sentry_sdk import dj_database_url from kombu import Exchange, Queue @@ -44,7 +44,6 @@ 'django.contrib.messages', 'django.contrib.staticfiles', # 3rd party - 'raven.contrib.django.raven_compat', 'rest_framework', 'rest_framework.authtoken', 'dj_rest_auth', @@ -151,10 +150,10 @@ STATIC_URL = '/static/' # Sentry configuration -RAVEN_CONFIG = { - # DevOps will supply you with this. - 'dsn': os.environ.get('MAGUIRE_SENTRY_DSN', None), -} +sentry_sdk.init( + dsn=os.environ.get('MAGUIRE_SENTRY_DSN', None), + environment=os.environ.get('ENVIRONMENT_NAME', 'DEVELOPMENT').lower() +) # CORS Support CORS_ORIGIN_ALLOW_ALL = True diff --git a/backend/requirements-dev.txt b/backend/requirements-dev.txt index d51b85e..5616966 100644 --- a/backend/requirements-dev.txt +++ b/backend/requirements-dev.txt @@ -23,8 +23,11 @@ celery==5.4.0 # via # -r requirements.in # django-celery-beat + # sentry-sdk certifi==2024.8.30 - # via requests + # via + # requests + # sentry-sdk cffi==1.17.1 # via cryptography charset-normalizer==3.4.0 @@ -68,6 +71,7 @@ django==4.2.17 # django-timezone-field # djangorestframework # graphene-django + # sentry-sdk django-celery-beat==2.7.0 # via -r requirements.in django-cors-headers==4.6.0 @@ -206,8 +210,6 @@ python-dateutil==2.9.0.post0 # time-machine pyyaml==6.0.2 # via responses -raven==6.10.0 - # via -r requirements.in requests==2.32.3 # via # -r requirements.in @@ -219,6 +221,8 @@ responses==0.25.3 # moto s3transfer==0.10.4 # via boto3 +sentry-sdk==2.19.2 + # via -r requirements.in six==1.17.0 # via # promise @@ -259,6 +263,7 @@ urllib3==2.2.3 # botocore # requests # responses + # sentry-sdk vine==5.1.0 # via # amqp diff --git a/backend/requirements.in b/backend/requirements.in index 6e8b201..55730da 100644 --- a/backend/requirements.in +++ b/backend/requirements.in @@ -16,7 +16,7 @@ dj-rest-auth psycopg[binary] # Sentry -raven +sentry-sdk[django,celery] # Celery celery diff --git a/backend/requirements.txt b/backend/requirements.txt index a595021..2619233 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -20,8 +20,11 @@ celery==5.4.0 # via # -r requirements.in # django-celery-beat + # sentry-sdk certifi==2024.8.30 - # via requests + # via + # requests + # sentry-sdk charset-normalizer==3.4.0 # via requests click==8.1.7 @@ -59,6 +62,7 @@ django==4.2.17 # django-timezone-field # djangorestframework # graphene-django + # sentry-sdk django-celery-beat==2.7.0 # via -r requirements.in django-cors-headers==4.6.0 @@ -145,12 +149,12 @@ python-dateutil==2.9.0.post0 # pendulum # python-crontab # time-machine -raven==6.10.0 - # via -r requirements.in requests==2.32.3 # via -r requirements.in s3transfer==0.10.4 # via boto3 +sentry-sdk==2.19.2 + # via -r requirements.in six==1.17.0 # via # promise @@ -184,6 +188,7 @@ urllib3==2.2.3 # via # botocore # requests + # sentry-sdk vine==5.1.0 # via # amqp