Created
July 29, 2014 17:15
-
-
Save mehdimehdi/3824b9576c25d4a04626 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import transaction | |
from django.contrib.sessions.models import Session | |
Session.objects.filter(expire_date__lt=datetime.datetime.now()).delete() | |
transaction.commit_unless_managed() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment