diff --git a/docs/getting_started/integrating_into_django.rst b/docs/getting_started/integrating_into_django.rst index 5ae58f97ea..8eda677d79 100644 --- a/docs/getting_started/integrating_into_django.rst +++ b/docs/getting_started/integrating_into_django.rst @@ -35,16 +35,12 @@ In your settings file, add the following apps to ``INSTALLED_APPS``: 'modelcluster', 'taggit', -Add the following entries to ``MIDDLEWARE``: +Add the following entry to ``MIDDLEWARE``: .. code-block:: python - 'wagtail.core.middleware.SiteMiddleware', 'wagtail.contrib.redirects.middleware.RedirectMiddleware', -.. note:: - Wagtail is currently incompatible with projects using ``django.contrib.sites.middleware.CurrentSiteMiddleware``, as both this and ``wagtail.core.middleware.SiteMiddleware`` set the attribute ``request.site``. - Add a ``STATIC_ROOT`` setting, if your project does not have one already: .. code-block:: python diff --git a/wagtail/contrib/settings/context_processors.py b/wagtail/contrib/settings/context_processors.py index b2a99ca49c..3a9516a523 100644 --- a/wagtail/contrib/settings/context_processors.py +++ b/wagtail/contrib/settings/context_processors.py @@ -57,9 +57,6 @@ def settings(request): site = Site.find_for_request(request) if site is None: # find_for_request() can't determine the site - # old SiteMiddleware case - # Unittest or email templates might also mock request - # objects that don't have a request.site. return {} else: return SettingsProxy(site) diff --git a/wagtail/core/views.py b/wagtail/core/views.py index 5438b51b8f..1d3943854d 100644 --- a/wagtail/core/views.py +++ b/wagtail/core/views.py @@ -8,8 +8,7 @@ from wagtail.core.models import Page, PageViewRestriction, Site def serve(request, path): - # we need a valid Site object corresponding to this request (set in wagtail.core.middleware.SiteMiddleware) - # in order to proceed + # we need a valid Site object corresponding to this request in order to proceed site = Site.find_for_request(request) if not site: raise Http404 diff --git a/wagtail/project_template/project_name/settings/base.py b/wagtail/project_template/project_name/settings/base.py index 3fd204495d..fdb60602c2 100644 --- a/wagtail/project_template/project_name/settings/base.py +++ b/wagtail/project_template/project_name/settings/base.py @@ -59,7 +59,6 @@ MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', - 'wagtail.core.middleware.SiteMiddleware', 'wagtail.contrib.redirects.middleware.RedirectMiddleware', ]