Thanks, I did that, but my schedule task isn't working again and I can't see why...
I'm still getting the same error as in my previous message.
Did I miss something here ?
username = "kjules75"
api_token = "myToken"
domain_name = "kjules75.pythonanywhere.com"
proxy = 'http://proxy.server:3128'
response = requests.post('https://www.pythonanywhere.com/api/v0/user/{username}/webapps/{domain_name}/reload/'.format(username=username, domain_name=domain_name), headers={'Authorization': 'Token {token}'.format(token=api_token)}, proxies={'http':proxy})
[error message]
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 96, in create_connection
raise err
File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 86, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
>
> During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 353, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fbe371f3820>: Failed to establish a new connection: [Errno 111] Connection refused
>
> During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py", line 573, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.pythonanywhere.com', port=443): Max retries exceeded with url: /api/v0/user/kjules75/webapps/kjules75.pythonanywhere.com/reload/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fbe371f3820>: Failed to establish a new connection: [Errno 111] Connection refused'))
>
> During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/kjules75/NBA/scheduled_task.py", line 6, in <module>
response = requests.post(
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
>
> requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.pythonanywhere.com', port=443): Max retries exceeded with url: /api/v0/user/kjules75/webapps/kjules75.pythonanywhere.com/reload/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fbe371f3820>: Failed to establish a new connection: [Errno 111] Connection refused'))