def clear_sessions_relative(months=1, dry_run=False):
 logger.warn('Clearing sessions older than {0} months'.format(months))
 now = timezone.now()
 delta = relativedelta.relativedelta(months=months)
 clear_sessions((now - delta), dry_run=dry_run)

def clear_sessions_relative ( months = 1 , dry_run = False ) : logger . warn ( 'Clearing sessions older than {0} months' . format ( months ) ) now = timezone . now ( ) delta = relativedelta . relativedelta ( months = months ) clear_sessions ( ( now - delta ) , dry_run = dry_run )
remove all sessions last modified over months months ago .