Managing server manage.py

I am running python manage.py runningerver from machine A when I try to check machine B I typed url http: // A: 8000 / I get an error message System returned: (111) Connection refused

+64
python django
Apr 24 '11 at 5:20
source share
7 answers

You can run it for computers on your network using

./manage.py runningerver 0.0.0.0:8000

And how can you contact the server from any computer on your network. Just enter on another computer in the browser http://192.168.0.1:8000 , where 192.168.0.1 is the IP of your server ... and it is ready to work ....

or in your case:

  • On machine A at the command line ./manage.py runserver 0.0.0.0:8000
  • Try in machine B in the browser http://A:8000
  • Take a sip of beer.

Source from django docs

+118
Apr 24 2018-11-11T00:
source share

You need to provide manage.py with the local IP address and to connect the port. Something like python manage.py runserver 192.168.23.12:8000 . Then use the same ip and port from another computer. You can read about it here in the documentation.

+14
Apr 24 '11 at 5:24 a.m.
source share

I struggled with the same problem and found one solution. I think this can help you. when you run python manage.py runningerver, it will accept 127.0.0.1 as the default ip address and 8000. 127.0.0.0 is the same as localhost, which can be accessed locally. to access it from a cross source you need to run it on your ip system or 0.0.0.0. 0.0.0.0 can be obtained from any source on the network. for the port number, you need to set the outgoing and outgoing policies of your system if you want to use your own port number and not the default number.

To do this, you need to start the server with the python manage.py runserver 0.0.0.0:<your port> , as described above

or, set the ip and default port in your python environment. For this, see my answer on django change the port to start by default

Enjoy the coding .....

+5
Jun 29 '16 at 8:45
source share

Just in case, if Windows users have problems, I thought that I would add my own experience. When running python manage.py runserver 0.0.0.0:8000 I could view the urls using localhost:8000 but not my IP address 192.168.1.3:8000 .

In the end, I disabled ipv6 on my wireless adapter and launched ipconfig /renew . After that, everything worked as expected.

+3
Dec 11 '15 at 2:49
source share

in a flask using flask.ext.script, you can do it like this:

python manage.py runserver -h 127.0.0.1 -p 8000

+3
Jan 16 '16 at 9:47
source share

I had the same problem, and here was my way to solve it:

You must know your IP address first. On my Windows PC, in cmd windows, I launch ipconfig and select my V4 IP address. In my case, 192.168.0.13

Secondly, as mentioned above: runningerver 192.168.0.13:8000

It worked for me. The error I made to receive the message is using the gateway address, not my PC.

0
Sep 24 '15 at 9:23
source share

For people who use CentOS7 to allow access to port 8000, you need to change the firewall rules in the new SSH connection:

 sudo firewall-cmd --zone=public --permanent --add-port=8000/tcp sudo firewall-cmd --reload 
0
Sep 22 '19 at 0:16
source share



All Articles