manage.py runserver

前端 未结 8 1388
情话喂你
情话喂你 2020-11-28 22:36

I am running python manage.py runserver from a machine A when I am trying to check in machine B The url I typed is http://A:8000/ I am getting an error like The system retu

8条回答
  •  野性不改
    2020-11-28 22:53

    I was struggling with the same problem and found one solution. I guess it can help you. when you run python manage.py runserver, it will take 127.0.0.1 as default ip address and 8000. 127.0.0.0 is the same as localhost which can be accessed locally. to access it from cross origin you need to run it on your system ip or 0.0.0.0. 0.0.0.0 can be accessed from any origin in the network. for port number, you need to set inbound and outbound policy of your system if you want to use your own port number not the default one.

    To do this you need to run server with command python manage.py runserver 0.0.0.0: as mentioned above

    or, set a default ip and port in your python environment. For this see my answer on django change default runserver port

    Enjoy coding .....

提交回复
热议问题