Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TAlone
memopol
Commits
86a541b4
Commit
86a541b4
authored
Jul 20, 2016
by
Nicolas Joyard
Browse files
Enable logging 404s on sentry
Active when DATA_DIR/sentry.404 exists
parent
e5773f79
Changes
1
Hide whitespace changes
Inline
Side-by-side
memopol/settings.py
View file @
86a541b4
...
...
@@ -285,6 +285,7 @@ if DEBUG:
logger
[
'handlers'
].
append
(
'debug'
)
RAVEN_FILE
=
os
.
path
.
join
(
DATA_DIR
,
'sentry'
)
RAVEN_404_FILE
=
os
.
path
.
join
(
DATA_DIR
,
'sentry.404'
)
if
os
.
path
.
exists
(
RAVEN_FILE
):
INSTALLED_APPS
+=
(
'raven.contrib.django.raven_compat'
,)
...
...
@@ -298,6 +299,13 @@ if os.path.exists(RAVEN_FILE):
'propagate'
:
False
,
}
if
os
.
path
.
exists
(
RAVEN_404_FILE
):
RAVEN_MIDDLEWARE
=
(
'raven.contrib.django.raven_compat.middleware.Sentry404CatchMiddleware'
,
# noqa
)
MIDDLEWARE_CLASSES
=
RAVEN_MIDDLEWARE
+
MIDDLEWARE_CLASSES
with
open
(
RAVEN_FILE
,
'r'
)
as
f
:
RAVEN_CONFIG
=
{
'dsn'
:
f
.
read
().
strip
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment