How to access the local Django webserver from outside world

前端 未结 9 1717
天命终不由人
天命终不由人 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:32

    I had to add this line to settings.py in order to make it work (otherwise it showed an error when accessed from another computer)

    ALLOWED_HOSTS = ['*']
    

    then ran the server with:

    python manage.py runserver 0.0.0.0:9595
    

    Also ensure that the firewall allows connections to that port

提交回复
热议问题