[go: up one dir, main page]

Skip to content

A periodic task for removing expired Django sessions from the django_session table

License

Notifications You must be signed in to change notification settings

Kub-AT/django-session-cleanup

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Session Cleanup

A periodic task for removing expired Django sessions from the django_session table

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 on a weekly basis.

Usage

  1. Run pip install django-session-cleanup or place session_cleanup on your Python path.

  2. Add session_cleanup to your list of INSTALLED_APPS.

  3. Add an entry to, or create a CELERYBEAT_SCHEDULE in your project's settings:

    from session_cleanup.settings import weekly_schedule
    CELERYBEAT_SCHEDULE = {
        ...
        'session_cleanup': weekly_schedule
    }
    

About

A periodic task for removing expired Django sessions from the django_session table

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%