From c12dc8869fa8e4e4cfd51a8adbe9ef115a9dc4fc Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Fri, 15 Nov 2024 09:58:13 +0100 Subject: [PATCH] docs: add documentation regarding MaintenanceMiddleware --- docs/source/configuration.rst | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index 0f008dfad..86350b388 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -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. \ No newline at end of file +`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``.