Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Max retries exceeded (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

I’m getting an error max retries exceeded and 403 forbidden but when I run server on localhost it’s working perfectly fine. I’m showing data from an API in django template I also tried to turn off validation and keep alive sessions but nothing intersting happened I’m getting same error

my code:

def index(request):
    try:
        url = "https://www.hetzner.com/a_hz_serverboerse/live_data.json"
        s = requests.session()
        s.keep_alive = False
        r = requests.post(url, verify=False, timeout=5)

        data = response.json()['server']
        p = Paginator(data, 20)
        pn = request.GET.get('page')
        page_obj = p.get_page(pn)
        context = {
            'data': data,
            'page_obj': page_obj
        }
        return render(request, 'index.html', context)


    except requests.exceptions.ConnectionError as e:
        return HttpResponse({e})

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Then the server you are using doesn’t have an outgoing Internet connection or there is a proxy that you need to configure in your code so you can reach the internet, this is an infrastructure issue and not and a software development issue, so you need to check with Admin and/or provider support.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading