def _connDB(self):
configuration = MongoConfig()
mongo_client = pymongo.MongoClient(host=configuration.host, port=configuration.port)
self._client = mongo_client
try:
db = mongo_client[configuration.db_name]
if configuration.username is not None:
db.authenticate(configuration.username, password=configuration.password)
self._currentDB = db
except:
pass
评论列表
文章目录