其他分享
首页 > 其他分享> > django框架-报错requests.exceptions.ConnectionError:Failed to establish a new connection: [Errno -5] No a

django框架-报错requests.exceptions.ConnectionError:Failed to establish a new connection: [Errno -5] No a

作者:互联网

requests.exceptions.ConnectionError: HTTPConnectionPool(host='xxx', port=80): Max retries exceeded with url: /xx/api/v1/login (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f224f867b50>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))

(排查了代码和卸载了requests之后,都无果)

应第一时间验证网络问题,看是否能ping通,具体查阅网络7层

1.在本地(windows)看是否能ping通,(可以)

2.在虚拟机看是否能ping通,(不能)

那就能定位问题了,在 /etc/hosts 添加 ip-域名 的映射,问题解决

 

标签:associated,ConnectionError,No,Errno,ping,报错,requests
来源: https://www.cnblogs.com/student-luo/p/15119453.html