django-session-timeout
Add timestamp to sessions to expire them independently
Installation
pip install django-session-timeout
Usage
Update your settings to add the SessionTimeoutMiddleware:
MIDDLEWARE_CLASSES = [
# ...
'django.contrib.sessions.middleware.SessionMiddleware',
'django_session_timeout.middleware.SessionTimeoutMiddleware',
# ...
]
And also add the SESSION_EXPIRE_SECONDS:
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:
SESSION_EXPIRE_AFTER_LAST_ACTIVITY = True
By default, last activiy will be grouped per second.
To group by different period use the following setting:
SESSION_EXPIRE_AFTER_LAST_ACTIVITY_GRACE_PERIOD = 60 # group by minute
To redirect to a custom URL define the following setting:
SESSION_TIMEOUT_REDIRECT = 'your_redirect_url_here/'
Metadata
Release files for django-session-timeout 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-session-timeout-0.1.0.tar.gz | 2.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_session_timeout-0.1.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 6.8 kB
Release files / django-session-timeout-0.1.0.tar.gz
| Download URL | django-session-timeout-0.1.0.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
648fe4ffa762f3bb62ce7a9ed1bbba8e37648158d555f18a880471982941084c
|
|
BLAKE2b-256 checksum How to use checksums |
6f989b3330c7e54360a94a3fdc43526deba8b7339d72a4f8da35799d79c1f608
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
|
Release files / django_session_timeout-0.1.0-py2.py3-none-any.whl
| Download URL | django_session_timeout-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e01b2502d4b9995edb93be1a66f304d0314cecb4f671ddc26cb4525a07e56282
|
|
BLAKE2b-256 checksum How to use checksums |
7ff11166326c05ff647e32c3b71e6e1afe15272ad7d6c1fad101a9d798f6c2f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
|