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 diff --git a/setup.py b/setup.py index 4475898..529b5e3 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import find_packages, setup docs_require = [ - 'sphinx>=1.4.0', + 'sphinx>=1.8.4', ] tests_require = [