Django 0.0.0.0:80; can't access remotely

后端 未结 7 2103
孤街浪徒
孤街浪徒 2020-12-15 04:28

I\'m trying to access my Django server from another computer on the same network. I\'ve set up my server and can view everything correctly usingpython manage.py runse

7条回答
  •  情歌与酒
    2020-12-15 05:22

    When running it from Ubuntu, it said permission denied when I tried to do this:

        python manage.py runserver 0.0.0.0:80
    

    Since it was a permission issue the following worked just fine like Ryan and gtujan said.

        sudo python manage.py runserver 0.0.0.0:80
    

    NOTE: that you are running a server on port 80, which is a HTTP Port. So when typing the URL from your web-browser you do not necessarily need to type ":80" in your URL.

        http://192.168.1.146:80/
    

    The following should suffice. Even if you do type ":80" it is considered the same.

        http://192.168.1.146/
    

    However for other port numbers such as 8000 etc, :8000 is required to be part of the URL.

提交回复
热议问题