Django manage.py runserver无法正常工作

编程入门 行业动态 更新时间:2024-10-26 20:31:55
本文介绍了Django manage.py runserver无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

尝试使用命令启动服务器时遇到问题

I am facing problem while trying to start the server using the command

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 0.0.0.0:8000/ Quit the server with CTRL-BREAK.

但是无法通过在浏览器中访问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

工作正常。我可以访问应用程序 127.0.0.1:8000

it is working fine. i can access the application 127.0.0.1:8000

可能是问题所在。

推荐答案

您的外部IP似乎正在使用端口8000。请查看进程是否正在运行并杀死它。

It looks like Port 8000 is in use by your external IP. Please have a look if a process is running and kill it.

您可以使用 netstat -a 。在Debian中,您可以通过 netstat -tulpn获得PID。 grep 8000 。最后一行应显示类似 1234 / python 的内容。现在,用 kill 1234 杀死它。

You can check the open ports with netstat -a. In Debian you get the PID with netstat -tulpn | grep 8000. The last line should display something like 1234/python. Now kill it with kill 1234.

或者,您可以重新启动系统;-)

Alternative you could restart your system ;-)

更多推荐

Django manage.py runserver无法正常工作

本文发布于:2023-10-22 22:18:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1518889.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法正常   工作   manage   Django   runserver

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!