Skip to main content

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

  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
    }

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

django-session-cleanup-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

django_session_cleanup-1.0.0-py2.py3-none-any.whl (4.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-session-cleanup-1.0.0.tar.gz.

File metadata

File hashes

Hashes for django-session-cleanup-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5dac3cc04710401ed014607b0399d04468e5644f8a78644d957838281dbd9a25
MD5 f89b3df526c3d86a46bb4313ff22becf
BLAKE2b-256 6ce5ef8477b9622f0646d78b55cdfa2a4be2d3ce4a3934a310d04358d4953af5

See more details on using hashes here.

File details

Details for the file django_session_cleanup-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_session_cleanup-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3e97ca712ec1e1476fba5ded79bb4be8d733d5bf34cf144135875b104ec03ca6
MD5 b141a6bce5c7ac2404bebac2186868e5
BLAKE2b-256 2186221c810e5387b06e63bd939f0a58f0930f417c085360566819b2b4a40195

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page