Skip to content

Commit a796be5

Browse files
committed
chore(settings): Install sentry-sdk
1 parent 0336235 commit a796be5

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/config/context_processors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ def get_session_cookie_age(request):
1010

1111
def get_environment(request):
1212
return {
13-
'environment': "debug" if settings.DEBUG else "production"
13+
'environment': "debug" if settings.DEBUG else "production",
14+
"sentry_dsn": settings.SENTRY_DSN,
1415
}

src/config/settings/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"""
1212

1313
import os
14+
import sentry_sdk
1415

1516
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1617
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@@ -227,6 +228,11 @@
227228
},
228229
}
229230

231+
# Sentry
232+
233+
SENTRY_DSN = 'https://2e878ab38ea0468f870435702d667330@o1194684.ingest.sentry.io/6317549'
234+
sentry_sdk.init(SENTRY_DSN, traces_sample_rate=1.0,)
235+
230236

231237
# Crispy
232238

src/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ pandas==1.1.2
1919
celery==4.4.6
2020
django-redis==4.11.0
2121
pyminizip==0.2.4
22+
sentry-sdk==1.5.12

src/templates/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
<script type="text/javascript">
9191
/* Sentry settings */
9292
Sentry.init({
93-
dsn: "https://2e878ab38ea0468f870435702d667330@o1194684.ingest.sentry.io/6317549",
93+
dsn: "{{ sentry_dsn }}",
9494
environment: "{{ environment }}",
9595
});
9696
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {

0 commit comments

Comments
 (0)