Skip to content

Instantly share code, notes, and snippets.

@huhuhang
Created March 27, 2019 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huhuhang/ddd08debd4d7ba33ff7a4981137a9591 to your computer and use it in GitHub Desktop.
Save huhuhang/ddd08debd4d7ba33ff7a4981137a9591 to your computer and use it in GitHub Desktop.
Flask run in Jupyter Notebook
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiahe224
Copy link

get 时总是报错怎么办?
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001F2DAE51910>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。'))

试过搜到的方案:
proxies = { "http": None, "https": None}
os.environ['NO_PROXY'] = 'http://127.0.0.1:5000'
session = requests.Session()
session.trust_env = False
session.get(url="http://127.0.0.1:5000", proxies=proxies).content

还是未解决报错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment