Django Server Error: port is already in use

Ashish Kumar Saxena picture Ashish Kumar Saxena · Nov 27, 2013 · Viewed 249.1k times · Source

Restarting the Django server displays the following error:

this port is already running....

This problem occurs specifically on Ubuntu and not other operating systems. How can I free up the port to restart the server?

Answer

Mounir picture Mounir · Nov 27, 2013

A more simple solution just type sudo fuser -k 8000/tcp. This should kill all the processes associated with port 8000.

EDIT:

For osx users you can use sudo lsof -t -i tcp:8000 | xargs kill -9