import requests from asgiref.sync import sync_to_async async def req(): results = await sync_to_async(get_saldo, thread_sensitive=True) def get_saldo(r): #r = requests.get('https://app2.comercio-digital.mx/x3/saldo?usr=SCT050708AD1&pwd=0dcu2SwCv',verify=False) return {'saldo':'j'}