How to access django server from different network?

Viewed 540

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..

2 Answers

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

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

Related