For Django newbies, there will be many problems during the learning process, which often encounters the problem is Error: That port is already in Use
.
There are two ways to solve (assuming 8000 ports):
python manage.py runserver 8001
2.1 Enter the lsof -i: 8000
in the terminal, list the process information.
2.2 Then, find the PID number of the process, such as my PID number is 2277.
2.3 Enter kill -9 PID
, such as KILL-9 2277
, you can turn off the port.
2.4 Use python management.py runserver
to continue using the 8000 port.