summaryrefslogtreecommitdiff
path: root/docs/howto/error-reporting.txt
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-01-01 22:28:48 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-01-15 17:41:45 +0100
commit50a985b09b439a0d52aad8694d377a3483cb02e1 (patch)
tree4d8cee59543565917f52c9c6e311dbcda5330a94 /docs/howto/error-reporting.txt
parent83d0cc52141dbbd977da836fd7f77e0e735e2110 (diff)
Fixed #19099 -- Split broken link emails out of common middleware.
Diffstat (limited to 'docs/howto/error-reporting.txt')
-rw-r--r--docs/howto/error-reporting.txt19
1 files changed, 11 insertions, 8 deletions
diff --git a/docs/howto/error-reporting.txt b/docs/howto/error-reporting.txt
index 742b81b7e2..7f3c68c136 100644
--- a/docs/howto/error-reporting.txt
+++ b/docs/howto/error-reporting.txt
@@ -54,18 +54,24 @@ setting.
Django can also be configured to email errors about broken links (404 "page
not found" errors). Django sends emails about 404 errors when:
-* :setting:`DEBUG` is ``False``
+* :setting:`DEBUG` is ``False``;
-* :setting:`SEND_BROKEN_LINK_EMAILS` is ``True``
-
-* Your :setting:`MIDDLEWARE_CLASSES` setting includes ``CommonMiddleware``
- (which it does by default).
+* Your :setting:`MIDDLEWARE_CLASSES` setting includes
+ :class:`django.middleware.common.BrokenLinkEmailsMiddleware`.
If those conditions are met, Django will email the users listed in the
:setting:`MANAGERS` setting whenever your code raises a 404 and the request has
a referer. (It doesn't bother to email for 404s that don't have a referer --
those are usually just people typing in broken URLs or broken Web 'bots).
+.. note::
+
+ :class:`~django.middleware.common.BrokenLinkEmailsMiddleware` must appear
+ before other middleware that intercepts 404 errors, such as
+ :class:`~django.middleware.locale.LocaleMiddleware` or
+ :class:`~django.contrib.flatpages.middleware.FlatpageFallbackMiddleware`.
+ Put it towards the top of your :setting:`MIDDLEWARE_CLASSES` setting.
+
You can tell Django to stop reporting particular 404s by tweaking the
:setting:`IGNORABLE_404_URLS` setting. It should be a tuple of compiled
regular expression objects. For example::
@@ -92,9 +98,6 @@ crawlers often request::
(Note that these are regular expressions, so we put a backslash in front of
periods to escape them.)
-The best way to disable this behavior is to set
-:setting:`SEND_BROKEN_LINK_EMAILS` to ``False``.
-
.. seealso::
404 errors are logged using the logging framework. By default, these log