sync def index(request):
async with aiohttp.ClientSession() as client:
data=await(email_sending(client))
await client.post('http://127.0.0.1:8000/acc/signup/',data=data)
return web.Response(text="OK")
async def email_sending(client):
async with client.get('http://www.mocky.io/v2/5c1ba9c633000052007fd919') as resp:
resp=await(resp.json())
totp = pyotp.TOTP('base32secret3232')
otp=totp.now()
smtp.sendmail("you@gmail.com",resp['email'], otp)
sucess=await(email_verification(otp,client))
async def email_verification(otp,client):
# async with client.Session() as client:
async with client.get('http://127.0.0.1:8000/connect/hello/') as v_otp:
v_otp=await(v_otp.json())
print(v_otp)
вот мой код
здесь всякий раз, когда я пытаюсь запустить сервер, я получаю эту ошибку, говоря, что соединение было отклонено хост-машиной программного обеспечения, и я даже не могу понять, как решить эту проблему.помощь приветствуется