0

hello guys I'm trying to make another one to access my Django website I host it on my localhost by type

python manage.py runserver 0.0.0.0:8000

and i set the ALLOWED_HOSTS = ['*']

when I trying to connect with my IP it's says refused to connect. can someone help me

ii_MaRTin
  • 1
  • 3
  • are you using your local machines IP in your URL? is this an internal ip like 192 or 172 or 10 address? if so then they will need to target your public ip of forexample your router then your router will need some portforwarding to forward that traffic internally – Chris Doyle Feb 03 '21 at 17:05
  • Does this answer your question? [How to make a web server respond to a request outside the local network?](https://stackoverflow.com/questions/31657819/how-to-make-a-web-server-respond-to-a-request-outside-the-local-network) – tanaydin Feb 03 '21 at 17:11

1 Answers1

-1

you are only hosting your server in your local network therefore no-one outside of this network can access your server. To make them access it you would have to make it accessible over the internet for example via hosting it on aws or another cloud hoster.

  • Why cant they use port forwarding to reach the internal address from the public address? – Chris Doyle Feb 03 '21 at 17:10
  • @ChrisDoyle they abseloutly could. They just havent and it is probably easier to set it up on aws or azure than explaining port forwarding. I have intentionaly written "for example " to imply that there are other ways of doing it. – professorchen Feb 03 '21 at 17:14