Skip to main content

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
    }

Metadata

Release files for django-session-cleanup 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-session-cleanup 4.0.0
File Size Uploaded
django-session-cleanup-4.0.0.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-session-cleanup 4.0.0
File Interpreter ABI Platform
django_session_cleanup-4.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.7 kB

Release files / django-session-cleanup-4.0.0.tar.gz

Download URL django-session-cleanup-4.0.0.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3a0954fbe2bb509b6a6bb9d1299a92d83d928b99541eb15e9469a8bf3e53953f
BLAKE2b-256 checksum
How to use checksums
648189cbdc349deeff060080fd2136ea091a8a0b35ba39fea50f4b94249f62d6
Upload date
Uploaded using Trusted Publishing?
What is 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+

Release files / django_session_cleanup-4.0.0-py3-none-any.whl

Download URL django_session_cleanup-4.0.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8432ec8e4cc5c1e00dd99399a84677867dd0c216799c0c1dc31b554f48a021a5
BLAKE2b-256 checksum
How to use checksums
e1491bdcfae712654461ecb344f49166525ddb85c02e8090f4c12f2a42133f00
Upload date
Uploaded using Trusted Publishing?
What is 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+

Release history Release notifications | RSS feed

This release

4.0.0 This release

2 release files

3.0.0

2 release files

2.0.0

3 release files

1.0.0

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page