0

I have a brand new Django setup on my computer, I ran the command runserver, and I get an ERR_CONNECTION_REFUSED in chrome.

localhost is added to allowed_hosts and I get no error in django, when I check for the port it is not active.

I am running Django in wsl and accessing chrome from windows on the same machine

I have tried adding to my IP, changing browser, adding to allowed hosts, I initially had this issue in another project and I set up this new project to see if the problem would resolve, it didn't and the new project is completely clean no way something could be messed up there.

I tried running the server in windows and finally got an error

Error: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions

I ran it with a whole lot of different port numbers which I am sure is not in used but no luck.

Any help would be greatly appreciated

edit 3: lol a simple restart of my computer did the trick, I guess it was a port blocking which is really weird because I tried dozens of ports and it didn't show up in use when I used netstat

  • Are you running the server in a virtualenv? Do you have the server running on a different port? Please add more information about the environment – Tony Jan 05 '21 at 22:17
  • How are you running it and how are you trying to access it – iklinac Jan 05 '21 at 22:17
  • From the error message you posted, does this answer help? https://stackoverflow.com/a/2779304/243925 – Tony Jan 05 '21 at 22:21
  • @Tony I am running it inside a virtual env, the same environment was working until today and I didn't make any changes to it, as far as the answer you shared I didn't find it useful but thanks for trying – ISAAC FINKELSTEIN Jan 05 '21 at 22:25
  • @ISAACFINKELSTEIN Since you have found a resolution to your problem either close the question or, rather than adding the solution to the question, post it as an answer (you can answer your own questions on SO). Then this will not show up as unanswered. – Tony Jan 06 '21 at 12:04
  • The answer seems to be to disable Windows fast-startup see: https://stackoverflow.com/questions/63452108/get-err-connection-refused-accessing-django-running-on-wsl2-from-windows-but-can/63455770#63455770 – Peter Goodall Sep 13 '21 at 01:00

0 Answers0