修改成777无敌权限
sudo chmod 777 /etc/hosts
编辑/etc/hosts
文件,可以设置本地域名
sudo vim /etc/hosts
在文件中增加信息
127.0.0.1 www.liuxinyu12378.com
这时,
域名
www.liuxinyu12378.com 就成了本地的域名地址

2.Windows系统
编辑 C:WindowsSystem32driversetchosts
设置allowed_hosts
#允许哪些主机访问,这是Django中的配置文件 setting.py
ALLOWED_HOSTS = ['127.0.0.1','www.liuxinyu12378.com']