Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #2748 -- Turned into something that will run a…

…gainst the

current version of Django.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1f8cc30f5f525ac53134b7d24cb8afeb7bcd0538 1 parent cb82926
@malcolmt malcolmt authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 django/bin/
13 django/bin/
@@ -1,16 +1,17 @@
-"Daily cleanup file"
+Daily cleanup job.
-from django.db import backend, connection, transaction
+Can be run as a cronjob to clean out old data from the database (only expired
+sessions at the moment).
-DOCUMENTATION_DIRECTORY = '/home/html/documentation/'
+from django.db import backend, connection, transaction
def clean_up():
# Clean up old database records
cursor = connection.cursor()
cursor.execute("DELETE FROM %s WHERE %s < NOW()" % \
- (backend.quote_name('core_sessions'), backend.quote_name('expire_date')))
- cursor.execute("DELETE FROM %s WHERE %s < NOW() - INTERVAL '1 week'" % \
- (backend.quote_name('registration_challenges'), backend.quote_name('request_date')))
+ (backend.quote_name('django_session'), backend.quote_name('expire_date')))
if __name__ == "__main__":

0 comments on commit 1f8cc30

Please sign in to comment.
Something went wrong with that request. Please try again.