Django running project port occupied
Problem Description:
./manage.py runserver 8000 did not stop after starting the A project, and also used runserver 8000 to start the B project. At this time, the 8000 port display is still the display page of the A project
Solution:
Start---->Run---->cmd, or window+R key combination, call up the command window
Enter the command: netstat -ano to list the status of all ports. In the list, we observe the occupied port, such as the port 8000 we are using, and find it first.
To view the PID corresponding to the occupied port, enter the command: tasklist|findstr "11984" and press Enter to view the program currently using the port.
Open the task manager ----> detailed information and end the corresponding PID program
Or enter taskkill /f /t /im python.exe in CMD to end the program.
Note: This command will end all ports under the program. If there are other programs with the same name that you don't want to close, it is best not to end the program.