我尝试使用命令启动服务器时遇到了问题
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
可能存在问题,我不确定是否被之前默认分配8000
端口的python manage.py runserver
占用了。我认为这不应该发生。 - curiousguypython manage.py runserver
运行良好,它正在端口8000
上运行,http:\\127.0.0.1:8000
。 - curiousguynetstat -tulpn | grep 8000
以查看外部IP是否仍在使用端口8000。 - Thomas Schwärzl