SJ19
SJ19

Reputation: 2123

Django/Python - Error: That port is already in use

I'm trying to host my Django website for the first time, but it appears that the port is already in use. I haven't hosted anything before and I get the following result with netstat -ntlp:

enter image description here

I would like to keep the standard port if possible... does anyone know a solution? I'm not sudo user.

Upvotes: 0

Views: 15342

Answers (4)

Saroj Rai
Saroj Rai

Reputation: 1609

open your Terminal and try this,

sudo fuser -k 8000/tcp

Upvotes: 5

Yasara J
Yasara J

Reputation: 1

Sometimes there may be another server is running under that port in your machine or
Use

python manage.py runserver 8000

Note: You can user any port

Upvotes: -2

schrodingerscatcuriosity
schrodingerscatcuriosity

Reputation: 1860

If you can't kill the process because you don't have permissions, just serve django in a different port:

python manage.py runserver 8001

Upvotes: 4

Ankita Gupta
Ankita Gupta

Reputation: 583

You need to kill the process which is running on port 8000.To kill, find out the process identifier number or PID of the process to be killed, then pass the PID number to the kill command. For Mac OS/X you can list the process by:lsof -i:8000

And then kill the PID by: kill -9 PID

Upvotes: 8

Related Questions