api.py 文件源码

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

项目:HBCTF 作者: osteth 项目源码 文件源码
def dbconnect():
    with open('DBdata.json') as data_file:    
        data = json.load(data_file)
        ssl = data.get('ssl')
        username = data.get('username')
        password = data.get('password')
        host = data.get('host')
        port = data.get('port')
        data_file.close()
        if ssl is False:
            ssl = 'http://'
        else: 
            ssl = 'https://'
        couch = couchdb.Server(ssl + str(username) + ':' + str(password) + '@' + str(host) +':' + str(port) + '/')
        return(couch)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号