def __init__(self): self.username = L4info.get_id() self.password = L4info.get_pw() self.url = 'https://' + L4info.get_l4ip() self.headers = { 'Content-Type': 'application/json', 'Accept-Charset': 'UTF-8' }
def db_connect(): db_ip = L4info.get_db_ip() db_id = L4info.get_db_id() db_pw = L4info.get_db_pw() conn = MySQLdb.connect(host=db_ip, user=db_id, passwd=db_pw, db='TEST') cur = conn.cursor() try: yield (conn, cur) finally: cur.close() conn.close()
def __init__(self, l4ip): self.username = L4info.get_id() self.password = L4info.get_pw() self.url = 'https://' + l4ip self.payload = {'expandSubcollections': 'true'} self.headers = { 'Content-Type': 'application/json', 'Accept-Charset': 'UTF-8' } self.db_id = L4info.get_db_id() self.db_pw = L4info.get_db_pw() self.db_ip = L4info.get_db_ip()
def __init__(self, l4ip): self.username = L4info.get_id() self.password = L4info.get_pw() self.url = 'https://' + l4ip self.payload = {'expandSubcollections': 'true'} self.headers = { 'Content-Type': 'application/json', 'Accept-Charset': 'UTF-8' } self.db_id = L4info.get_db_id() self.db_pw = L4info.get_db_pw() self.db_ip = L4info.get_db_ip() # InsecureRequestWarning: Unverified HTTPS request is being made 문제 해결 requests.packages.urllib3.disable_warnings(InsecureRequestWarning)