我正在在线学习本教程 https://simpleisbetterthancomplex.com/tutorial/2016/10/14/how-to-deploy-to-digital-ocean.html
我进入中间步骤,我想检查我是否可以通过 IP 地址访问该应用程序。我运行 python manage.py runserver 0.0.0.0:8000
返回以下内容:
System check identified no issues (0 silenced).
November 22, 2018 - 17:41:08
Django version 2.1.3, using settings 'mysite.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
所以没有错误。然后我导航到 my_droplet_ip
:8000 并超时。 “花了很长时间才回应。”
我正在从用户而不是 root 运行 runserver 命令。不知道这是否重要...
知道这里发生了什么吗?
最佳答案
我必须通过运行命令 sudo ufw allow 8080
来公开端口 8000。教程中的任何地方都没有提到...
关于django 应用程序未在 digitalocean 液滴上提供服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53436082/