0

我使用了与 drf 网站上的教程相同的代码

当我跑步时

python manage.py runserver

它在终端给了我这个

    Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
July 10, 2021 - 07:12:08
Django version 3.2.5, using settings 'drftut.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Firefox 给了我这个错误:

连接已超时

127.0.0.1 的服务器响应时间过长。

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.

我还在使用 wsl1 和 vscode 远程桌面进行 wsl 并且我在 python 环境中运行它

4

1 回答 1

1

kill $(lsof -t -i:8000) 在终端或 cmd 中使用此命令来终止已经在 PORT 8000 上运行的进程。如果这对您也不起作用,请尝试在另一个 PORTpython manage.py runserver 5000或任何其他空闲端口上运行服务器

于 2021-07-10T07:38:49.040 回答