From b673cb53cbf06d9365f6299fa854f55629fd1cea Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Sat, 19 Jan 2019 05:58:03 +0300 Subject: [PATCH] add sentry --- config/settings.py | 7 +++++++ example.env | 1 + requirements.txt | 1 + 3 files changed, 9 insertions(+) diff --git a/config/settings.py b/config/settings.py index 91de303..1647bac 100644 --- a/config/settings.py +++ b/config/settings.py @@ -1,6 +1,7 @@ import os import environ +import raven BASE_DIR = environ.Path(__file__) - 2 @@ -22,6 +23,7 @@ INSTALLED_APPS = [ 'django.contrib.messages', 'django.contrib.staticfiles', + 'raven.contrib.django.raven_compat', 'django_extensions', 'bootstrap4', @@ -89,3 +91,8 @@ MEDIA_ROOT = str(PUBLIC_ROOT.path('uploads')) LOGIN_URL = 'cabinet:login' LOGIN_REDIRECT_URL = 'cabinet:index' LOGOUT_REDIRECT_URL = LOGIN_URL + +RAVEN_CONFIG = { + 'dsn': env.str('SENTRY_DSN', None), + 'release': raven.fetch_git_sha(os.path.abspath(os.pardir)), +} diff --git a/example.env b/example.env index 53c8c88..1ff1e66 100644 --- a/example.env +++ b/example.env @@ -1,2 +1,3 @@ DJANGO_DEBUG = False DATABASE_URL = postgres://bots:bots@localhost/bots +SENTRY_DSN = https:// diff --git a/requirements.txt b/requirements.txt index f02dfd2..4b4c65e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,6 +13,7 @@ kombu==4.2.2.post1 psycopg2-binary==2.7.6.1 pyTelegramBotAPI==3.6.6 pytz==2018.9 +raven==6.10.0 redis==3.0.1 requests==2.21.0 six==1.12.0