1

The infamous ConnectionAbortedError: [WinError 10053] error:

ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

has obviously caused a whole lot of headaches when searching the internet. There are many workarounds suggested on different forums. This post suggests that antivirus (i.e., Windows Defender) and the firewall should be disabled, which doesn't seem like a wise idea. And this post suggests adding:

port 8000 to allowed rules for both incoming and outgoing traffic

which I prefer not to do, simply because I don't know the implications of messing around with the firewall. The same post, however, also suggests adding the line:

127.0.0.1   localhost.localdomain localhost

to the /etc/hosts, which according to this post should be \WINDOWS\system32\drivers\etc\hosts on Windows OS. However, doing so (adding the above line to the hosts file) did not help with the above error. So my questions, as the title implies, is that if there is a way to solve the said problem or circumvent it, without messing around with the Windows Defender and firewall, and jeopardizing the system's safety/security?

Foad S. Farimani
  • 12,396
  • 15
  • 78
  • 193

1 Answers1

1

I also had this problem, and I did several searches on the internet, but in the end probably the solution, for me, was easier than expected: that error comes out when a resource is not found.

In my case it couldn't find some .js files, due to wrong <link ..> directives (static was not used).

Fixed this, the problem was greatly mitigated, but sometimes it came back, and always after a Not Found: /favicon.ico error.

Doing other research I discovered that browsers often make a default request to have a favicon.ico file in the root, which obviously isn't there.

By adding a redirect url (r '^ favicon \ .ico $', RedirectView.as_view (url = '/ static / images / favicon.ico')), in the file urls.py, this problem is also solved.

Now the problem seems to be gone, so I assume it was derived, at least in this case, from resources not correctly found by Django.

I hope my experience could help.

Zompa
  • 448
  • 4
  • 8