Hi!
I’m having trouble using ASANA API on a PythonAnywhere website, this works perfectly locally, and on their python 3.7 shell.
but, when Ran on the server I can use my API key, and confirm authentication - after that it halts.
import asana
@action('index', method=['GET', 'POST'])
def index():
user = auth.get_user()
message = T("Hello {first_name}".format(**user))
key = "MYKEY"
asana_api = asana.Client.access_token(key)
print("asana_api, ",asana_api)
print(asana_api.session.authorized)
me = asana_api.users.me() #halts on this line, or any use of the asana_api
return dict(message=message)
my console logs are
2021-02-08 22:24:37 asana_api, <asana.client.Client object at 0x7f536c5f0750>
2021-02-08 22:24:37 True
and the webpage stalls until it eventually times out.
This will also time out,
for workspace in asana_api.workspaces.find_all():
print ("workspace, ",workspace)
workspace_gid = workspace.get('gid')
pretty much any ASANA API call except for the ones shown above will time out…
Thanks so much! Willing to provide any other necessary details
after 5 minutes or so, the logs are:
2021-02-08 22:24:37 asana_api, <asana.client.Client object at 0x7f536c5f0750>
2021-02-08 22:24:37 True
2021-02-08 22:29:39 Mon Feb 8 22:29:38 2021 - *** HARAKIRI ON WORKER 2 (pid: 8, try: 1) ***
2021-02-08 22:29:39 Mon Feb 8 22:29:38 2021 - HARAKIRI !!! worker 2 status !!!
2021-02-08 22:29:39 Mon Feb 8 22:29:38 2021 - HARAKIRI [core 0] 10.0.0.124 - GET /simpleASANA/index since 1612823077
2021-02-08 22:29:39 Mon Feb 8 22:29:38 2021 - HARAKIRI !!! end of worker 2 status !!!
2021-02-08 22:29:39 DAMN ! worker 2 (pid: 8) died, killed by signal 9 :( trying respawn ...
2021-02-08 22:29:39 Respawned uWSGI worker 2 (new pid: 13)
2021-02-08 22:29:39 spawned 2 offload threads for uWSGI worker 2