Update sentry settings
This commit is contained in:
parent
1196c4ff80
commit
d97b46fc23
|
|
@ -35,6 +35,7 @@ DEBUG = bool_value(os.environ.get('DEBUG', ''))
|
||||||
TEST = 'test' in sys.argv
|
TEST = 'test' in sys.argv
|
||||||
ENABLE_SILKY = bool_value(os.environ.get('ENABLE_SILKY', ''))
|
ENABLE_SILKY = bool_value(os.environ.get('ENABLE_SILKY', ''))
|
||||||
SERVE_VIA_WEBPACK = bool_value(os.environ.get('SERVE_VIA_WEBPACK', DEBUG))
|
SERVE_VIA_WEBPACK = bool_value(os.environ.get('SERVE_VIA_WEBPACK', DEBUG))
|
||||||
|
ENABLE_SENTRY = not DEBUG or bool_value(os.environ.get('ENABLE_SENTRY_DEBUG', ''))
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
|
|
@ -44,6 +45,7 @@ if not DEBUG:
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
'core',
|
'core',
|
||||||
'api',
|
'api',
|
||||||
|
|
@ -318,16 +320,18 @@ LOGGING = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if not DEBUG and os.environ.get('SENTRY_DSN'):
|
if ENABLE_SENTRY and os.environ.get('SENTRY_DSN'):
|
||||||
import sentry_sdk
|
import sentry_sdk
|
||||||
from sentry_sdk.integrations.django import DjangoIntegration
|
from sentry_sdk.integrations.django import DjangoIntegration
|
||||||
|
|
||||||
|
|
||||||
def before_send(event, hint):
|
def before_send(event, hint):
|
||||||
user = event['user']
|
user = event['user']
|
||||||
id = user['id']
|
id = user['id']
|
||||||
event['user'] = {'id': id}
|
event['user'] = {'id': id}
|
||||||
return event
|
return event
|
||||||
|
|
||||||
|
|
||||||
environment = os.environ.get('SENTRY_ENV', 'localhost')
|
environment = os.environ.get('SENTRY_ENV', 'localhost')
|
||||||
|
|
||||||
sentry_sdk.init(
|
sentry_sdk.init(
|
||||||
|
|
@ -391,7 +395,6 @@ TASKBASE_SUPERPASSWORD = os.environ.get("TASKBASE_SUPERPASSWORD")
|
||||||
TASKBASE_BASEURL = os.environ.get("TASKBASE_BASEURL")
|
TASKBASE_BASEURL = os.environ.get("TASKBASE_BASEURL")
|
||||||
ENABLE_SPELLCHECK = True if TASKBASE_BASEURL else False
|
ENABLE_SPELLCHECK = True if TASKBASE_BASEURL else False
|
||||||
|
|
||||||
|
|
||||||
TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'
|
TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'
|
||||||
TEST_OUTPUT_DIR = './test-reports/'
|
TEST_OUTPUT_DIR = './test-reports/'
|
||||||
TEST_OUTPUT_VERBOSE = 1
|
TEST_OUTPUT_VERBOSE = 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue