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

Uploaded Source

Built Distribution

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

Uploaded Python 3

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

Hashes for django-session-cleanup-4.0.0.tar.gz
Algorithm Hash digest
SHA256 3a0954fbe2bb509b6a6bb9d1299a92d83d928b99541eb15e9469a8bf3e53953f
MD5 77aee6544daac3d6456178bd1562a537
BLAKE2b-256 648189cbdc349deeff060080fd2136ea091a8a0b35ba39fea50f4b94249f62d6

See more details on using hashes here.

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

Hashes for django_session_cleanup-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8432ec8e4cc5c1e00dd99399a84677867dd0c216799c0c1dc31b554f48a021a5
MD5 f7e13bad4a63472c7a6da377fd8e1769
BLAKE2b-256 e1491bdcfae712654461ecb344f49166525ddb85c02e8090f4c12f2a42133f00

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