A periodic task for removing expired Django sessions from the django_session table
Project description
A periodic task for removing expired Django sessions from the django_session table
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 on a weekly basis.
Usage
Run pip install django-session-cleanup or place session_cleanup on your Python path.
Add session_cleanup to your list of INSTALLED_APPS.
Add an entry to, or create a 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
Hashes for django-session-cleanup-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd804d407ec54e42205785a6338756e669ed3d42b9b4641ae61adb5679b6d40a |
|
MD5 | 4c2203b3e377e9ddc365d7e227ed227b |
|
BLAKE2b-256 | 6bd184e6692b0798a33ff57d651f6fb5f2817302d54081a94f21a609e6d0b8e3 |