Skip to content

Commit

Permalink
docs: add documentation regarding MaintenanceMiddleware
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Nov 15, 2024
1 parent af031e4 commit c12dc88
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/source/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,20 @@ APIS_LIST_VIEW_OBJECT_FILTER
Allows to define a function that receives the view - including e.g. the
`request` object - and a queryset and can do custom filtering on that queryset.
This can be used to set the listviews to public using the
`APIS_LIST_VIEWS_ALLOWED` setting, but still only list specific entities.
`APIS_LIST_VIEWS_ALLOWED` setting, but still only list specific entities.


Maintenance Middleware
^^^^^^^^^^^^^^^^^^^^^^

APIS ships a maintenance middlware that you can use and activate to enable a maintenance mode in your project.
Maintenance mode means that only superuser accounts can access the webinterfaces, all other requests are being
answered with a simple maintenance mode page (the ``maintenance.html`` template).
To use the middleware, add

.. code-block:: python
"apis_core.core.middleware.MaintenanceMiddleware"
to your ``settings.MIDDLEWARE`` list. To activate the maintenance mode once the middlware is enabled, simply
create a file ``/tmp/apis_maintenance``.

0 comments on commit c12dc88

Please sign in to comment.