本地运行可以使用localhost访问,但是放在服务器运行就不可以了 解决办法: python manage.py runserver 0.0.0.0:8000 # 监听所有IP(我的理解就是允许所有IP访问)