Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access from external to python development server

Tags:

python

django

I can't access externally to python development server, I have a very small django project running on my machine, and now I want to enable computers in the same LAN have access to it, but it can't do.

There is no firewall running on my machine. Is there a way around this?

like image 360
user469652 Avatar asked Nov 01 '10 23:11

user469652


People also ask

How do I run a development server?

Running the local development server ( dev_appserver.py ) To run the tool, you can either specify the full path when you run dev_appserver.py , or you can add dev_appserver.py to your PATH environment variable. In the directory that contains your app. yaml configuration file, run the dev_appserver.py command.


1 Answers

How are you running the server?
Have you tried something like this?

manage.py runserver 0.0.0.0:8080

From the documentation:

Note that the default IP address, 127.0.0.1, is not accessible from other machines on your network. To make your development server viewable to other machines on the network, use its own IP address (e.g. 192.168.2.1) or 0.0.0.0.

0.0.0.0 means: bind to all IP addresses this computer supports. So, as TheSingularity says, you'll then be able to access your Django app by entering the private IP address usually beginning with 192.168.*; which is not accessible from the Internet.

like image 106
mechanical_meat Avatar answered Oct 09 '22 04:10

mechanical_meat