diff options
| author | Berker Peksag <berker.peksag@gmail.com> | 2014-11-07 21:57:04 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-11-27 07:55:07 -0500 |
| commit | 093e6c68b9b5afdf1f059a2321affc999763e919 (patch) | |
| tree | 69c763023d9fa3deeec23c579d5854f22e9e5ffc /docs | |
| parent | bd337184f1b4901abdfd07b0219d6b9b45d0de2f (diff) | |
Fixed #14664 -- Logged a warning if MiddlewareNotUsed is raised in DEBUG mode.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/1.8.txt | 4 | ||||
| -rw-r--r-- | docs/topics/http/middleware.txt | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 1593f26b79..b06c32ce5f 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -337,6 +337,10 @@ Middleware <django.middleware.common.CommonMiddleware.response_redirect_class>` attribute allows you to customize the redirects issued by the middleware. +* A debug message will be logged to the ``django.request`` logger when a + middleware raises a :exc:`~django.core.exceptions.MiddlewareNotUsed` exception + in :setting:`DEBUG` mode. + Migrations ^^^^^^^^^^ diff --git a/docs/topics/http/middleware.txt b/docs/topics/http/middleware.txt index 3a05e64751..cc7607da0a 100644 --- a/docs/topics/http/middleware.txt +++ b/docs/topics/http/middleware.txt @@ -269,7 +269,14 @@ Marking middleware as unused It's sometimes useful to determine at run-time whether a piece of middleware should be used. In these cases, your middleware's ``__init__`` method may raise :exc:`django.core.exceptions.MiddlewareNotUsed`. Django will then remove -that piece of middleware from the middleware process. +that piece of middleware from the middleware process and a debug message will +be logged to the ``django.request`` logger when :setting:`DEBUG` is set to +``True``. + +.. versionchanged:: 1.8 + + Previously, :exc:`~django.core.exceptions.MiddlewareNotUsed` exceptions + weren't logged. Guidelines ---------- |
