Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

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.


  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
        '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.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_session_cleanup-1.0.0-py2.py3-none-any.whl (4.1 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Apr 9, 2018
django-session-cleanup-1.0.0.tar.gz (3.1 kB) Copy SHA256 hash SHA256 Source None Apr 9, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page