django accessing localhost from any machine connected to any network

varad

I have a django project that I am running on localhost:8000 and that works fine. Now I want it to access from any machine that is connnected to other network.

Doing some google I found that I can do it by setting port forwarding from my router. I have a tplink router and I did the following setting:

Service Port:27015
IP Address: my_ip_address   # obtained by ifconfig
Protocol: All
Status: Enabled

Now I run my project with python manage.py my_ip_address:27015

But when I run with my_ip_address:27015 in url from another machine connected to another network I cannot view my site/page

Can anyone help me how to access my localhost outside the globe?

warath-coder

You can not access localhost form outside; localhost servers will only respond on the localhost "device".

you need to start the server, in this case django, and have it bind to your local address (192.168, or 10., etc).

python manage.py runserver 0.0.0.0:8000

will have it bind to all available IP addresses on your machine.

Then you can port forward on your router to your local machine (disable any firewall for that port on your local machine)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Is there any way to scan a lan network with dhcp enabled to see the IP of the connected devices from a GNU/Linux machine?

From Dev

django run localhost from another computer connected to another network

From Dev

Accessing localhost from virtual machine

From Dev

Accessing localhost API endpoint from different machine

From Dev

Accessing VirtualBox localhost from host machine

From Dev

Accessing localhost (xampp) from another network?

From Dev

Is there any limitation on EC2 machine or network?

From Dev

Is there any SSL handshakes when trying to load https://localhost from browser on local machine?

From Dev

Accessing Wamp localhost from Android Device connected through Router

From Dev

localhost not accessible from a device that is connected to the same network over wifi

From Dev

accessing an iis localhost path from another computer on the network

From Dev

Accessing a web server on a Mac Virtual Machine from the Mac Host and Network

From Dev

Accessing Docker container from another machine in an internal network

From Dev

Any API to prevent Windows 8 from going into connected standby mode?

From Dev

Any API to prevent Windows 8 from going into connected standby mode?

From Dev

403 on any localhost resource

From Dev

Accessing an element that is currently being hovered by mouse, from any where in the document

From Dev

Restrict user from accessing any programs but one (win 10)

From Dev

One SSH key for accessing the server from any operating system

From Dev

Scala: Accessing/casting entries from Map[String, Any] or better alternative

From Dev

Nvidia Optimus not connected to any display?

From Dev

Is there any way to change the default output shape of a fully connected layer in a convolutional neural network?

From Dev

4G LTE router network - ping works but no internet in browser on any connected device

From Dev

What mechanism prevents any user from accessing any other user's files via root?

From Dev

Using JDBC to access localhost database from any computer

From Dev

XAMPP via SSH: Accessing localhost on a remote machine

From Dev

Accessing any data in a Struct with a variable?

From Dev

Is there a way to execute a perl script from any location in the machine?

From Dev

Accessing host machine as localhost from a Docker container that's also inside a boot2docker vm

Related Related

  1. 1

    Is there any way to scan a lan network with dhcp enabled to see the IP of the connected devices from a GNU/Linux machine?

  2. 2

    django run localhost from another computer connected to another network

  3. 3

    Accessing localhost from virtual machine

  4. 4

    Accessing localhost API endpoint from different machine

  5. 5

    Accessing VirtualBox localhost from host machine

  6. 6

    Accessing localhost (xampp) from another network?

  7. 7

    Is there any limitation on EC2 machine or network?

  8. 8

    Is there any SSL handshakes when trying to load https://localhost from browser on local machine?

  9. 9

    Accessing Wamp localhost from Android Device connected through Router

  10. 10

    localhost not accessible from a device that is connected to the same network over wifi

  11. 11

    accessing an iis localhost path from another computer on the network

  12. 12

    Accessing a web server on a Mac Virtual Machine from the Mac Host and Network

  13. 13

    Accessing Docker container from another machine in an internal network

  14. 14

    Any API to prevent Windows 8 from going into connected standby mode?

  15. 15

    Any API to prevent Windows 8 from going into connected standby mode?

  16. 16

    403 on any localhost resource

  17. 17

    Accessing an element that is currently being hovered by mouse, from any where in the document

  18. 18

    Restrict user from accessing any programs but one (win 10)

  19. 19

    One SSH key for accessing the server from any operating system

  20. 20

    Scala: Accessing/casting entries from Map[String, Any] or better alternative

  21. 21

    Nvidia Optimus not connected to any display?

  22. 22

    Is there any way to change the default output shape of a fully connected layer in a convolutional neural network?

  23. 23

    4G LTE router network - ping works but no internet in browser on any connected device

  24. 24

    What mechanism prevents any user from accessing any other user's files via root?

  25. 25

    Using JDBC to access localhost database from any computer

  26. 26

    XAMPP via SSH: Accessing localhost on a remote machine

  27. 27

    Accessing any data in a Struct with a variable?

  28. 28

    Is there a way to execute a perl script from any location in the machine?

  29. 29

    Accessing host machine as localhost from a Docker container that's also inside a boot2docker vm

HotTag

Archive