Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mobolic/django-session-cleanup
A periodic task for removing expired Django sessions from the django_session table
https://github.com/mobolic/django-session-cleanup
celery celerybeat django
Last synced: about 2 months ago
JSON representation
A periodic task for removing expired Django sessions from the django_session table
- Host: GitHub
- URL: https://github.com/mobolic/django-session-cleanup
- Owner: mobolic
- License: bsd-2-clause
- Created: 2012-05-24T22:28:12.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-07-09T08:32:26.000Z (over 1 year ago)
- Last Synced: 2024-03-25T20:08:22.105Z (10 months ago)
- Topics: celery, celerybeat, django
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 33
- Watchers: 4
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
======================
Django Session Cleanup
======================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
-----1. Run ``pip install django-session-cleanup``.
2. Add ``session_cleanup`` to ``INSTALLED_APPS`` in your project's settings.
3. Edit or create ``CELERYBEAT_SCHEDULE`` in your project's settings::
from session_cleanup.settings import weekly_schedule
CELERYBEAT_SCHEDULE = {
...
'session_cleanup': weekly_schedule
}