How to access the local Django webserver from outside world

前端 未结 9 1699
天命终不由人
天命终不由人 2020-12-02 04:06

I followed the instructions here to run Django using the built-in webserver and was able to successfully run it using python manage.py runserver. If I access 1

9条回答
  •  爱一瞬间的悲伤
    2020-12-02 04:30

    Pick one or more from:

    • Your application isn't successfully listening on the intended IP:PORT
      • Because you haven't configured it successfully
      • Because the user doesn't have permission to
    • Your application is listening successfully on the intended IP:PORT, but clients can't reach it because
      • The server local iptables prevents it.
      • A firewall prevents it.

    So, you can check that your application is listening successfully by running lsof -i as root on the machine and look for a python entry with the corresponding port you've specified.

    Non-root users generally cannot bind to ports < 1024.

    You'll need to look at iptables -nvL to see if there's a rule that would prevent access to the ip:port that you are trying to bind your application to.

    If there is an upstream firewall and you don't know much about it, you'll need to talk to your network administrators.

提交回复
热议问题