A periodic task for removing expired Django sessions with Celery.
Project description
For projects that use the cached_db or db session engines, the django_session table can get quite large after a while.
Django provides the ‘cleanup’ management command for deleting expired sessions from this table but you have to either run this command manually or set-up a cron job.
Django Session Cleanup provides a periodic task for Celery that will delete expired sessions.
Usage
Run pip install django-session-cleanup.
Add session_cleanup to INSTALLED_APPS in your project’s settings.
Edit or create CELERYBEAT_SCHEDULE in your project’s settings:
from session_cleanup.settings import weekly_schedule CELERYBEAT_SCHEDULE = { ... 'session_cleanup': weekly_schedule }
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-session-cleanup-4.0.0.tar.gz
.
File metadata
- Download URL: django-session-cleanup-4.0.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a0954fbe2bb509b6a6bb9d1299a92d83d928b99541eb15e9469a8bf3e53953f |
|
MD5 | 77aee6544daac3d6456178bd1562a537 |
|
BLAKE2b-256 | 648189cbdc349deeff060080fd2136ea091a8a0b35ba39fea50f4b94249f62d6 |
File details
Details for the file django_session_cleanup-4.0.0-py3-none-any.whl
.
File metadata
- Download URL: django_session_cleanup-4.0.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8432ec8e4cc5c1e00dd99399a84677867dd0c216799c0c1dc31b554f48a021a5 |
|
MD5 | f7e13bad4a63472c7a6da377fd8e1769 |
|
BLAKE2b-256 | e1491bdcfae712654461ecb344f49166525ddb85c02e8090f4c12f2a42133f00 |