middlewares.py 文件源码

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

项目:old-web 作者: cualbondi 项目源码 文件源码
def get_mongodb_connection(cls):
        if cls._connection is not None:
            return cls._connection
        try:
            cls._connection = pymongo.Connection(
                "{0}:{1}".format(
                    REQUEST_LOGGING_BACKEND['host'],
                    REQUEST_LOGGING_BACKEND['port']
                )
            )
            return cls._connection
        except Exception as e:
            # TODO: Add log here.
            return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号