2

I have my Django application running with python manage.py runserver 0.0.0.0:8000 It is accessible within same network in every device with <your LAN ipv4 address>:8000

However. I want to access this outside my network with <your public address>:8000 What is the way to do this?

  1. Django app is running on windows 10.
  2. I have already written ALLOWED HOSTS : ["*"]

Maybe there's some issue with DNS or firewall. 0.0.0.0 should let me access with <your public address>:8000 but it is not giving access.

Please help..

ruohola
  • 21,987
  • 6
  • 62
  • 97
AbdulSamad
  • 101
  • 1
  • 9

2 Answers2

0

Method 1: In case if you have a static public IP then you can run enabling the firewall port on which the server is running to access the Django site.

Method 2: You can use a 3rd party service like Ngrok or noip.com to host the server on Windows 10.

Ngrok : https://ngrok.com/

NoIP: https://www.noip.com/

Method 3: Running on a cloud platform like AWS or Google Cloud

xenon
  • 307
  • 3
  • 11
  • Yes, i have static public ip address, i have already added inbound port rule in firewall settings. still can't access from outside network. ---- I don't want to go with method 2 and 3. – AbdulSamad Sep 11 '20 at 13:39
  • As I already linked you you need to setup port forwarding on your router as your public ip is most likely behind NAT. This is less programing question but more in line with general hardware and software superuser community. – iklinac Sep 11 '20 at 13:51
  • Can anyone help me please, i understand it is not a programming question but i need a solution. – AbdulSamad Sep 12 '20 at 16:27
0

I have resolved my issue. Everything was good, i just allowed incoming connection on port 8000 in AWS ec2 console. Now it's working. Thank you.

Now i can access it with <your public address>:8000

AbdulSamad
  • 101
  • 1
  • 9