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)
评论列表
文章目录