A socket operation was attempted to an unreachable network in python httplib

前端 未结 1 1967
北荒
北荒 2021-01-13 12:56

I am trying to make a REST client from django using httplib . But it is refusing the connection I tried the following

import hashlib
import hmac
from django.         


        
相关标签:
1条回答
  • 2021-01-13 13:24

    The error indicates that your the machine you are running this script on cannot reach the destination IP address (10.0.2.2), as it doesn't have a network route configured from one to the other.

    This is a problem with your internal network (10.x.x.x IP addresses are always private network addresses). If you are running this script on a different network from the machine you are trying to reach, you'll need a public IP address for it instead.

    0 讨论(0)
提交回复
热议问题