{"id":18930036,"url":"https://github.com/labd/django-session-timeout","last_synced_at":"2025-08-20T20:32:24.856Z","repository":{"id":24608457,"uuid":"102036605","full_name":"labd/django-session-timeout","owner":"labd","description":"Add timestamp to sessions to expire them","archived":false,"fork":false,"pushed_at":"2022-05-09T17:19:49.000Z","size":38,"stargazers_count":39,"open_issues_count":8,"forks_count":23,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-06-29T03:44:16.613Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/labd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-31T19:21:05.000Z","updated_at":"2025-05-20T02:45:01.000Z","dependencies_parsed_at":"2022-08-08T18:30:14.165Z","dependency_job_id":null,"html_url":"https://github.com/labd/django-session-timeout","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/labd/django-session-timeout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Fdjango-session-timeout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Fdjango-session-timeout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Fdjango-session-timeout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Fdjango-session-timeout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labd","download_url":"https://codeload.github.com/labd/django-session-timeout/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Fdjango-session-timeout/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271378680,"owners_count":24749192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T11:36:20.480Z","updated_at":"2025-08-20T20:32:24.507Z","avatar_url":"https://github.com/labd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- start-no-pypi --\u003e\n[![codecov](https://codecov.io/gh/labd/django-session-timeout/branch/master/graph/badge.svg)](https://codecov.io/gh/labd/django-session-timeout)\n[![pypi](https://img.shields.io/pypi/v/django-session-timeout.svg)](https://pypi.python.org/pypi/django-session-timeout/)\n[![readthedocs](https://readthedocs.org/projects/django-session-timeout/badge/)](https://django-session-timeout.readthedocs.io/en/latest/)\n[![tests](https://github.com/labd/django-session-timeout/workflows/Python%20Tests/badge.svg)](https://github.com/labd/django-session-timeout/actions)\n\u003c!-- end-no-pypi --\u003e\n\n# django-session-timeout\n\nAdd timestamp to sessions to expire them independently\n\n## Installation\n\n```shell\npip install django-session-timeout\n```\n\n## Usage\n\nUpdate your settings to add the SessionTimeoutMiddleware:\n\n```python\nMIDDLEWARE_CLASSES = [\n    # ...\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django_session_timeout.middleware.SessionTimeoutMiddleware',\n    # ...\n]\n```\n\nAnd also add the ``SESSION_EXPIRE_SECONDS``:\n\n\n```python\nSESSION_EXPIRE_SECONDS = 3600  # 1 hour\n```\n\nBy default, the session will expire X seconds after the start of the session.\nTo expire the session X seconds after the `last activity`, use the following setting:\n\n```python\nSESSION_EXPIRE_AFTER_LAST_ACTIVITY = True\n```\n\nBy default, `last activity` will be grouped per second.\nTo group by different period use the following setting:\n\n```python\nSESSION_EXPIRE_AFTER_LAST_ACTIVITY_GRACE_PERIOD = 60 # group by minute\n```\n\nTo redirect to a custom URL define the following setting:\n\n```python\nSESSION_TIMEOUT_REDIRECT = 'your_redirect_url_here/'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabd%2Fdjango-session-timeout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabd%2Fdjango-session-timeout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabd%2Fdjango-session-timeout/lists"}