當使用python manage.py runserver的時候出現(xiàn)127.0.0.1:8080 服務器拒絕訪問,這時候是我們修改了host文件里面的內容:
還是不好截圖....:
打開終端:
$ sudo gedit /etc/hosts
打開文件:
127.0.0.1 localhost
127.0.0.1 Inspiron-5421
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters```
這里我們只需要把:`127.0.0.1 Inspiron-5421` 給刪除掉就行了.當然前提是要備份一份hosts文件, 避免找不到一開始的文件了.