implement DatabaseWrapper.ensure_connection for django 1.6
modernise manage.py