diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/howto/error-reporting.txt | 19 | ||||
| -rw-r--r-- | docs/internals/deprecation.txt | 7 | ||||
| -rw-r--r-- | docs/ref/middleware.txt | 8 | ||||
| -rw-r--r-- | docs/ref/settings.txt | 13 | ||||
| -rw-r--r-- | docs/releases/1.6.txt | 18 |
5 files changed, 51 insertions, 14 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 diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index faa6d1ff02..63d65d1e4a 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -308,6 +308,13 @@ these changes. * The ``depth`` keyword argument will be removed from :meth:`~django.db.models.query.QuerySet.select_related`. +1.8 +--- + +* The ``SEND_BROKEN_LINK_EMAILS`` setting will be removed. Add the + :class:`django.middleware.common.BrokenLinkEmailsMiddleware` middleware to + your :setting:`MIDDLEWARE_CLASSES` setting instead. + 2.0 --- diff --git a/docs/ref/middleware.txt b/docs/ref/middleware.txt index 2b053d80ab..1e6e57f720 100644 --- a/docs/ref/middleware.txt +++ b/docs/ref/middleware.txt @@ -61,14 +61,16 @@ Adds a few conveniences for perfectionists: indexer would treat them as separate URLs -- so it's best practice to normalize URLs. -* Sends broken link notification emails to :setting:`MANAGERS` if - :setting:`SEND_BROKEN_LINK_EMAILS` is set to ``True``. - * Handles ETags based on the :setting:`USE_ETAGS` setting. If :setting:`USE_ETAGS` is set to ``True``, Django will calculate an ETag for each request by MD5-hashing the page content, and it'll take care of sending ``Not Modified`` responses, if appropriate. +.. class:: BrokenLinkEmailsMiddleware + +* Sends broken link notification emails to :setting:`MANAGERS` (see + :doc:`/howto/error-reporting`). + View metadata middleware ------------------------ diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 110d5dbdc9..d057323c06 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -1090,8 +1090,9 @@ query string, if any). Use this if your site does not provide a commonly requested file such as ``favicon.ico`` or ``robots.txt``, or if it gets hammered by script kiddies. -This is only used if :setting:`SEND_BROKEN_LINK_EMAILS` is set to ``True`` and -``CommonMiddleware`` is installed (see :doc:`/topics/http/middleware`). +This is only used if +:class:`~django.middleware.common.BrokenLinkEmailsMiddleware` is enabled (see +:doc:`/topics/http/middleware`). .. setting:: INSTALLED_APPS @@ -1250,7 +1251,8 @@ MANAGERS Default: ``()`` (Empty tuple) A tuple in the same format as :setting:`ADMINS` that specifies who should get -broken-link notifications when :setting:`SEND_BROKEN_LINK_EMAILS` is ``True``. +broken link notifications when +:class:`~django.middleware.common.BrokenLinkEmailsMiddleware` is enabled. .. setting:: MEDIA_ROOT @@ -1448,6 +1450,11 @@ available in ``request.META``.) SEND_BROKEN_LINK_EMAILS ----------------------- +.. deprecated:: 1.6 + Since :class:`~django.middleware.common.BrokenLinkEmailsMiddleware` + was split from :class:`~django.middleware.common.CommonMiddleware`, + this setting no longer serves a purpose. + Default: ``False`` Whether to send an email to the :setting:`MANAGERS` each time somebody visits diff --git a/docs/releases/1.6.txt b/docs/releases/1.6.txt index e425036839..dcf6f2604a 100644 --- a/docs/releases/1.6.txt +++ b/docs/releases/1.6.txt @@ -46,3 +46,21 @@ Backwards incompatible changes in 1.6 Features deprecated in 1.6 ========================== + +``SEND_BROKEN_LINK_EMAILS`` setting +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:class:`~django.middleware.common.CommonMiddleware` used to provide basic +reporting of broken links by email when ``SEND_BROKEN_LINK_EMAILS`` is set to +``True``. + +Because of intractable ordering problems between +:class:`~django.middleware.common.CommonMiddleware` and +:class:`~django.middleware.locale.LocaleMiddleware`, this feature was split +out into a new middleware: +:class:`~django.middleware.common.BrokenLinkEmailsMiddleware`. + +If you're relying on this feature, you should add +``'django.middleware.common.BrokenLinkEmailsMiddleware'`` to your +:setting:`MIDDLEWARE_CLASSES` setting and remove ``SEND_BROKEN_LINK_EMAILS`` +from your settings. |
