【发布时间】:2014-02-17 22:34:19
【问题描述】:
我在尝试使用命令启动服务器时遇到问题
python manage.py runserver 0.0.0.0:8000
正在显示
C:\abc>python manage.py runserver 0.0.0.0:8000
Validating models...
0 errors found
Django version 1.4.9, using settings 'abc.settings'
Development server is running at http://0.0.0.0:8000/
Quit the server with CTRL-BREAK.
但无法通过http://127.0.0.1:8000在浏览器中访问
它正在显示:
Unable to connect
Firefox can't establish a connection to the server at 127.0.0.1:8000.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer's network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
但是当我尝试相同的时候
python manage.py runserver
它工作正常。我可以访问应用程序http://127.0.0.1:8000
可能是什么问题。
【问题讨论】:
-
奇怪它在尝试
python manage.py runserver 0.0.0.0:8080时对我有用,而不是python manage.py runserver 0.0.0.0:8000。端口8000的一些问题不确定它是否由早期的python manage.py runserver分配,默认情况下分配8000端口。我认为不应该。 -
我不确定这个问题。如果您将服务器作为 python manage.py runserver 0.0.0.0:8000 运行,您可以从 0.0.0.0:8000 访问您的站点
-
您是否尝试将其关闭再打开?不要误会我的意思 - 端口 8000 可能正在被您的“外部 IP”上的崩溃运行服务器使用
-
如果@init3是这种情况,那么为什么
python manage.py runserver工作正常,它在端口8000,http:\\127.0.0.1:8000上运行 -
是的,你是对的@init3 试过这个
C:\Users\15809>netstat -an Active Connections Proto Local Address Foreign Address State TCP 0.0.0.0:4105 0.0.0.0:0 LISTENING TCP 0.0.0.0:4728 0.0.0.0:0 LISTENING TCP 0.0.0.0:7163 0.0.0.0:0 LISTENING TCP 0.0.0.0:8000 0.0.0.0:0 LISTENING TCP 0.0.0.0:8000 0.0.0.0:0 LISTENING TCP 0.0.0.0:47001 0.0.0.0:0 LISTENING
标签: django python-2.7