How to disable InsecureRequestWarning: Unverified HTTPS request is being made.

If you use requests or urllib3, requests with SSL verification disabled will print this warning:

/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py:851: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)

If you want to disable this warning and you can’t just enable verification, add this code

import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

at the top of your Python file.