From a3f741e29386c2a87b99aacd0d71a649006e84f6 Mon Sep 17 00:00:00 2001 From: Nando Davis Date: Wed, 20 Feb 2019 13:08:16 +0100 Subject: [PATCH 1/3] Update sphinx --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d790b3d..11f87f7 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import find_packages, setup docs_require = [ - 'sphinx>=1.4.0', + 'sphinx>=1.8.4', ] tests_require = [ From 4b7c841729f9129122eb2dc02f599986399677cb Mon Sep 17 00:00:00 2001 From: Nando Davis Date: Wed, 27 Feb 2019 10:35:45 +0100 Subject: [PATCH 2/3] Add read the docs page --- README.rst | 1 + docs/index.rst | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/README.rst b/README.rst index d9dd042..5021e09 100644 --- a/README.rst +++ b/README.rst @@ -2,6 +2,7 @@ django-session-timeout ====================== +https://django-session-timeout.readthedocs.io/en/latest/ Status ====== diff --git a/docs/index.rst b/docs/index.rst index 9c8213c..39b853a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,3 +9,33 @@ Installation .. code-block:: shell pip install django_session_timeout + +Usage +===== + +Update your settings to add the SessionTimeoutMiddleware: + +.. code-block:: python + + MIDDLEWARE_CLASSES = [ + # ... + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django_session_timeout.middleware.SessionTimeoutMiddleware', + # ... + ] + + +And also add the ``SESSION_EXPIRE_SECONDS``: + + +.. code-block:: python + + SESSION_EXPIRE_SECONDS = 3600 # 1 hour + + +By default, the session will expire X seconds after the start of the session. +To expire the session X seconds after the `last activity`, use the following setting: + +.. code-block:: python + + SESSION_EXPIRE_AFTER_LAST_ACTIVITY = True From e827eede2a22f0562c8996670fe3a32fad080c19 Mon Sep 17 00:00:00 2001 From: Nando Davis Date: Wed, 27 Feb 2019 11:13:38 +0100 Subject: [PATCH 3/3] Add read the docs badge to readme --- README.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 5021e09..7d0565f 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,10 @@ django-session-timeout ====================== -https://django-session-timeout.readthedocs.io/en/latest/ +.. image:: https://readthedocs.org/projects/django-session-timeout/badge/?version=latest + :target: https://django-session-timeout.readthedocs.io/en/latest/?badge=latest + :alt: Documentation Status + Status ======