我的 google chrome 和 firefox(我仅有的两个浏览器)有问题
当使用 ./manage.py runserver 0.0.0.0:8000
运行我的 django 服务器时,当我转到 chrome 或 firefox 并输入 localhost:8000
chrome 重定向到http://www.localhost:8000/
你知道问题出在哪里吗??
我的主机文件是:
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost arch
127.0.0.1 example.com
最佳答案
添加这一行问题就解决了:
::1 localhost.localdomain localhost arch
在 /etc/hosts
文件中。
关于linux - localhost 重定向到 http ://www. localhost:8000/,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10742469/