Restarting the Django server displays the following error:
this port is already running....
This problem occurs specifically on Ubuntu and
Sorry for comment in an old post but It may help people
Just type this on your terminal
killall -9 python3
It will kill all python3 running on your machine and it will free your all port. Greatly help me when to work in Django project.
netstat -ntlp
It will show something like this.
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 6599/python
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN -
tcp 0 0 192.168.124.1:53 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp6 0 0 :::3306 :::* LISTEN
So now just close the port in which Django/python running already by killing the process associated with it.
kill -9 PID
in my case
kill -9 6599
Now run your Django app.
ps aux | grep manage
ubuntu 3438 127.0.0 2.3 40256 14064 pts/0 T 06:47 0:00 python manage.py runserver
kill -9 3438
Type 'fg' as command after that ctl-c.
Command:
Fg will show which is running on background. After that ctl-c will stop it.
fg
ctl-c