当debug为true的时候,ALLOWED_HOSTS是跳过无论用的。因此这里须要将debug关掉,令debug=false,ALLOWED_HOSTS=[ '*' ]表示全部的主机均可以访问python
开启django远程访问的命令是python manage.py runserver 0.0.0.0:8000,如今改成python manage.py runserver 0.0.0.0:8000 --insecure 便可。
参考连接:Django项目关闭debug模式后,静态文件没法加载的解决办法django