def validConnection():
    if django.db.connection.connection is None:
        django.db.connection.connection = django.db.connection.user.connection
return True

def close():
    pass
Per-session transactions in Django