django搭建的站点,通过localhost能访问,但是通过ip不能访问

问题:使用ip访问不了django站点,只能用127.0.0.1访问
 
 
解决方法:启动服务时ip使用0.0.0.0
 
使用gunicorn启动
gunicorn -w4 -b0.0.0.0:8020 UITestManage.wsgi
 
使用runserver启动
 python3 manage.py runserver 0.0.0.0:8020
 
原文地址:https://www.cnblogs.com/meitian/p/6434073.html