Error Trying to upload from cloud.
I made a django app to upload images to cloudinary. The upload works fine on localmachine, but when I uploaded my project to python anywhere, I started getting the folllowing error.
{
"status": "false",
"error": "Unexpected error - MaxRetryError("TCPKeepAliveHTTPSConnectionPool(host='api.cloudinary.com', port=443): Max retries exceeded with url: /v1_1/dk0qatnu1/video/upload (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f81448f8f70>: Failed to establish a new connection: [Errno 111] Connection refused'))")"
}
I can't figure out the exact cause, can someone please help me finding the problem if it is in cloudniary or python anywhere
Best Answer
-
Hi there,
PythonAnywhere uses a proxy server for internet access. Ensure that your Cloudinary configuration includes the correct proxy settings.To do so, you need to specify the
api_proxy
when configuring your Cloudinary object. Something like this:cloudinary.config( cloud_name = "sample", api_key = "874837483274837", api_secret = "a676b67565c6767a6767d6767f676fe1", api_proxy = "your_proxy_here", #For example: 'http://proxy.server:3128', # Replace with your actual proxy URL secure = True )
For more information, please see
I hope it will help.
Best Regards,Wissam
0
Answers
-
Hi Wissam,
I have already tried the api_proxy setup, I still get the same error. If I'm not wrong the http://proxy.server:3128 url is the proxy url, at least this is what I retreived from the the environ. Do I need any paid services to continue? Cause I'm using free accounts under both python anywhere and cloudinary.
update: I found the solution. The problem was I called the import before the configuration. Thank you for your fast feedback.0 -
Thank you so much, even tho I tried the api_proxy thing. I was importing before configuration.
This has helped me very much0 -
I'm glad to see that it is resolved.
Thank you for your update.
Wissam0 -
I am experiencing the same error yet have done everything that you have recommended , here is my code:
i have even added the proxy but still not working
0