Django running project port occupied

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
Insert picture description here
Insert picture description here

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.

[External link image transfer failed, the source site may have anti-leeching mechanism, it is recommended to save the image and upload it directly (img-NHseygRV-1587955497097)(8000.png)]

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.

[External link image transfer failed, the source site may have anti-leeching mechanism, it is recommended to save the image and upload it directly (img-10pMnF4Z-1587955497104)(80001.png)]

Open the task manager ----> detailed information and end the corresponding PID program

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-v4E7fxx9-1587955497111)(80002.png)]

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.

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-IFkuA4hC-1587955497118)(80003.png)]img-IFkuA4hC-1587955497118)]

Guess you like

Origin blog.csdn.net/weixin_45609519/article/details/105785511