(base)osx @ localhost Api_test%python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
July 16, 2020 - 05:36:03
Django version 3.0.8, using settings 'Api_test.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Error: That port is already in use.
(基本)osx @ localhost Api_test%
答案 0 :(得分:1)
如果您使用的是Mac,请尝试以下任一操作:
lsof -n -i4TCP:8000
sudo lsof -i tcp:8000
npx kill-port 8000
如果您使用的是Linux:
sudo fuser -k 8000/tcp
答案 1 :(得分:0)
我已经遇到了一段时间这个问题,我一直使用下面的代码:
fuser -k 8000/tcp
我在Ubuntu上,我遇到了这个问题...甚至尝试了VSCode和Pycharm的终端,但没有任何答案,然后尝试了上面的代码,它对我有用。