From 8b1f39a727be91aab40bdb37235718ed63ae1d50 Mon Sep 17 00:00:00 2001 From: Marissa Zhou Date: Fri, 5 Jun 2015 16:50:53 +0100 Subject: Fixed #24796 -- Added a hint on placement of SecurityMiddleware in MIDDLEWARE_CLASSES. Also moved it in the project template. --- docs/ref/middleware.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs/ref') diff --git a/docs/ref/middleware.txt b/docs/ref/middleware.txt index 8f88b6686c..d256347577 100644 --- a/docs/ref/middleware.txt +++ b/docs/ref/middleware.txt @@ -411,6 +411,12 @@ Middleware ordering Here are some hints about the ordering of various Django middleware classes: +#. :class:`~django.middleware.security.SecurityMiddleware` + + It should go near the top of the list if you're going to turn on the SSL + redirect as that avoids running through a bunch of other unnecessary + middleware. + #. :class:`~django.middleware.cache.UpdateCacheMiddleware` Before those that modify the ``Vary`` header (``SessionMiddleware``, -- cgit v1.3