socket.gaierror:[Errno 11004]getaddrinfo失败,django

socket.gaierror:[Errno 11004]getaddrinfo失败,django,django,python-3.x,python-requests,betfair,Django,Python 3.x,Python Requests,Betfair,我正在尝试创建一个Betfair交互式登录,遵循此[教程][1] 我不断收到错误信息,我的应用程序密钥正确,我的用户名和密码也正确,但我认为我无法让hoe将其设置为正确工作。请提供任何帮助。请参阅我的代码 import requests import json login_hearders = { 'Accept' : 'application/json', 'X-Application':APP_KEY_HERE, 'Content-Type'

我正在尝试创建一个Betfair交互式登录,遵循此[教程][1] 我不断收到错误信息,我的应用程序密钥正确,我的用户名和密码也正确,但我认为我无法让hoe将其设置为正确工作。请提供任何帮助。请参阅我的代码

import requests
import json

login_hearders = {
        'Accept' : 'application/json',
        'X-Application':APP_KEY_HERE,
        'Content-Type':'application/x-www-form-urlencoded '}

url = 'https://identitysso.betfair.au/api/login'

payload = {'username':'USERNAME_HERE','password':'PASSWORD_HERE'}


r = requests.post(url, data=payload,headers=login_hearders)

print(json.loads(r.text))

我不知道您要学习的教程是什么,但是,特定的主机(
identiysso.betfair.au
)是错误的。您需要
com
.au
版本

me@host$ host identitysso.betfair.au
Host identitysso.betfair.au not found: 3(NXDOMAIN)

me@host$ host identitysso.betfair.com.au
identitysso.betfair.com.au has address 987.654.32.1

(没有显示实际的DNS解析,因为这是DNS的重点)

在提出这样一个简单的问题之前,请不要懒得找到现有的答案。谷歌搜索“socketerror:[Errno 11004]”会给你很多提示(顺便说一句:socketerrors-可识别,因为它的数字范围为10000)