Skip to content

Commit

Permalink
Minor editing of the root middleware docs
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Sep 3, 2024
1 parent 84d68e8 commit 6a02d8d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions feincms3/root/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
The guide recommends using a middleware for the feincms3 pages app. This module
offers helpers and utilities to reduce the amount of code you have to write.
The reason why this module is called ``root`` is that the page app's mountpoint
has to be the Python app's mountpoint when using this. If that's not the case
you may want to write your own :ref:`urls-and-views`.
has to be the Python app's mountpoint when using this since the middleware uses
the value of ``request.path_info`` to find a page for the current request.
If you have other requirements you may want to write your own
:ref:`urls-and-views` or investigate if modifying ``request.path_info`` works;
the latter isn't recommended though since it's not officially supported by
Django.
Example code for using this module (e.g. ``app.pages.middleware``):
Expand Down Expand Up @@ -136,7 +141,8 @@ def create_page_if_404_middleware(*, queryset, handler, language_code_redirect=F
- ``language_code_redirect`` (``False``): Redirect visitor to the language
code prefix (e.g. ``/en/``, ``/de-ch/``) if request path equals the
script prefix (generally ``/``) and no active page for ``/`` exists.
script prefix (generally ``/``), no active page for ``/`` exists and the
prefixed version exists.
"""

def outer(get_response):
Expand Down

0 comments on commit 6a02d8d

Please sign in to comment.