Forums

cloudinary

I have this code in ,y django settings.

CLOUDINARY_STORAGE = {
    'CLOUD_NAME': os.getenv('CLOUD_STORAGE_NAME'),
    'API_KEY': os.getenv('CLOUD_STORAGE_API_KEY'),
    'API_SECRET': os.getenv('CLOUD_STORAGE_API_SECRET'),
    "API_PROXY":"http://proxy.server:3128"
}

DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.MediaCloudinaryStorage'

it doesnt work when i run it from pythonaywhere but works perfectly on my localhost

[edit by admin: formatting]

How are you putting those values into the environment? If it's using a .env file, is the file present? And are you specifying a full path to it when loading it up?

I'm using .bashrc file

The environment variables set up in your .bashrc won't be available in your web app environment. You can set up your environment variables on the web app configuration page.

now I get the error " Unexpected error - MaxRetryError("TCPKeepAliveHTTPSConnectionPool(host='api.cloudinary.com', port=443): Max retries exceeded with url: /v1_1/<my_cloud_name>/image/upload (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7baa171e40>: Failed to establish a new connection: [Errno 111] Connection refused'))") "

is <my_cloud_name> a real thing or leftover templating?

I removed the actual value from the error message and put that there. It has a real value

That error looks like the proxy is not being used to make the connection. Check the documentation of the library that you're using to make sure that that is how to use a proxy with it.