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-3.0.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

django_session_cleanup-3.0.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-session-cleanup-3.0.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.5

File hashes

Hashes for django-session-cleanup-3.0.0.tar.gz
Algorithm Hash digest
SHA256 941db9d9c8433a0dc11562c11ca253ea977e050b1c681f899ab48df203df62c6
MD5 d729eb2d50426219f529d8a3fd7e5ebc
BLAKE2b-256 f907ed3bc00b2eadd183cb4c7f04a80afd897a5078c6fb1e8ec660de82a01824

See more details on using hashes here.

File details

Details for the file django_session_cleanup-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: django_session_cleanup-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.5

File hashes

Hashes for django_session_cleanup-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c7c7f04503049e270797983e342f5db8f8a28963da44cb309a721acb7aa2b56
MD5 dd7ee6be923ee26f3093b2959aa77e0b
BLAKE2b-256 087f55abe9dfb73b1f02e6365e8cd82ea0529cc7ea3832ab332acf1197f782a4

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