from http.client import HTTPConnection
HTTPConnection.debuglevel = 1
import logging
# you need to initialize logging, otherwise you will not see anything from
# requests
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
requests_log = logging.getLogger("urllib3")
requests_log.setLevel(logging.DEBUG)
requests_log.propagate = True