daily_cleanup.py 388 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. """
  3. Daily cleanup job.
  4. Can be run as a cronjob to clean out old data from the database (only expired
  5. sessions at the moment).
  6. """
  7. from django_extensions.management.jobs import DailyJob
  8. class Job(DailyJob):
  9. help = "Django Daily Cleanup Job"
  10. def execute(self):
  11. from django.core import management
  12. management.call_command("clearsessions")