0

My POST and GET requests are generally working and not throwing errors but there is a specific GET Request that causes the following error:

net::ERR_CONNECTION_REFUSED

And closes my development server.

There is no traceback suggesting an error the server simply closes and I have to restart it.

def marker_info(request):
    template_name = 'testingland/electra.html'
    neLat = request.GET.get('neLat', None)
    neLng = request.GET.get('neLng', None)
    swLat = request.GET.get('swLat', None)
    swLng = request.GET.get('swLng', None)
    ne = (neLat, neLng)
    sw = (swLat, swLng)

    xmin = float(sw[1])
    ymin = float(sw[0])
    xmax = float(ne[1])
    ymax = float(ne[0])
    bbox = (xmin, ymin, xmax, ymax)
    print(bbox)

    geom = Polygon.from_bbox(bbox)

    qs = mapCafes.objects.filter(geolocation__coveredby=geom) //this is where it appears to fail
    print(qs)

    return JsonResponse([
            [cafe.cafe_name, cafe.cafe_address, cafe.geolocation.y, cafe.geolocation.x, cafe.source, cafe.venue_type, cafe.id]
            for cafe in qs
    ], safe=False)

I'm not quite sure where to go next in terms of debugging this problem.

deadant88
  • 920
  • 9
  • 24
  • check if it because of too much data to load and django development server can't complete the request in the HTTP timeout – Jisson Jan 09 '22 at 07:58
  • Thanks for the response - it's just 3 data points. – deadant88 Jan 09 '22 at 09:59
  • https://stackoverflow.com/questions/20825734/postgresql-connection-refused-check-that-the-hostname-and-port-are-correct-an – Jisson Jan 09 '22 at 12:15

0 Answers0