Skip to content

Commit

Permalink
Install Sentry and remove Rollbar (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmadMokhtar authored Dec 27, 2022
1 parent ea04205 commit 91d6d61
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 18,722 deletions.
6,236 changes: 0 additions & 6,236 deletions data_text/ar.jalalayn.txt

This file was deleted.

6,236 changes: 0 additions & 6,236 deletions data_text/ar.muyassar.txt

This file was deleted.

6,236 changes: 0 additions & 6,236 deletions data_text/quran-simple.txt

This file was deleted.

3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ pytz==2017.2
django-environ==0.4.4
django-filter==2.4.0
rollbar==0.14.5
psycopg2==2.8.5
psycopg2==2.8.5
sentry-sdk==1.12.1
7 changes: 6 additions & 1 deletion requirements/requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
autopep8==1.3.3
certifi==2022.12.7
chardet==3.0.4
charset-normalizer==2.1.1
codecov==2.0.16
configparser==3.5.0
coverage==4.4.2
Django==2.2.28
django-cors-headers==3.7.0
django-environ==0.4.4
django-filter==2.4.0
django-prometheus==2.2.0
django-silk==1.1.0
djangorestframework==3.11.2
drf-extensions==0.3.1
drf-tracking==1.5.0
enum34==1.1.6
flake8==3.4.1
flake8-isort==2.2.1
Expand All @@ -22,14 +25,16 @@ Jinja2==2.11.3
MarkupSafe==1.1.1
mccabe==0.6.1
model-mommy==1.6.0
prometheus-client==0.14.1
psycopg2==2.8.5
pycodestyle==2.3.1
pyflakes==1.5.0
Pygments>=2.7.4
Pygments==2.13.0
python-dateutil==2.6.1
pytz==2017.2
requests==2.20.1
rollbar==0.14.5
sentry-sdk==1.12.1
six==1.11.0
sqlparse==0.2.4
testfixtures==5.1.1
Expand Down
34 changes: 22 additions & 12 deletions tafseer_api/settings.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import os

from django.utils.translation import ugettext_lazy as _

import environ
import rollbar
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration

# Initialize environ
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand Down Expand Up @@ -130,15 +129,26 @@
] + REST_FRAMEWORK_PARSER
}

# Rollbar

ROLLBAR = {
'access_token': env('ROLLBAR_ACCESS_TOKEN', default=''),
'environment': 'development' if DEBUG else 'production',
'root': BASE_DIR,
}
rollbar.init(**ROLLBAR)

# CORS support

CORS_ALLOW_ALL_ORIGINS = True


# Sentry

sentry_dsn = env('SENTRY_DSN')
sentry_sdk.init(
dsn=sentry_dsn,
integrations=[
DjangoIntegration(),
],

# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production.
traces_sample_rate=1.0,

# If you wish to associate users to errors (assuming you are using
# django.contrib.auth) you may enable sending PII data.
send_default_pii=True
)
4 changes: 4 additions & 0 deletions tafseer_api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin

def trigger_error(request):
division_by_zero = 1 / 0

urlpatterns = [
url(r'^quran/', include('quran_text.urls')),
url(r'^tafseer/', include('quran_tafseer.urls')),
url(r'^admin/', admin.site.urls),
url(r'^api-auth/', include('rest_framework.urls',
namespace='rest_framework')),
url('sentry-debug/', trigger_error),
]

urlpatterns += i18n_patterns(url(r'^', include('docs.urls')))

0 comments on commit 91d6d61

Please sign in to comment.