Use pymongo.MongoClient() instead of deprecated pymongo.Connection()