db.py 文件源码

python
阅读 56 收藏 0 点赞 0 评论 0

项目:vote-site 作者: wangande 项目源码 文件源码
def __init__(self):
        asyn_client = asyncmongo.Client(
            pool_id='isdb',
            host=setting.MONGO_HOST,
            port=setting.MONGO_PORT,
            dbuser=setting.MONGO_USER,
            dbpass=setting.MONGO_PASS,
            dbname='admin',
            maxcached=150,
            maxconnections=150,
        )
        connection = Connection(setting.MONGO_HOST, setting.MONGO_PORT)

        options["asyn_client"] = asyn_client
        AsyncBaseModel.configure(asyn_client)
        options["mono_conn"] = connection
        logging.error("{}".format("[init]Mongodb init success"))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号