Wednesday, October 10, 2012

How to fix django runserver 'port already in use' error

This usually happens if you  $ python runserver 8000 and then don't stop the server by hitting Cntrl+C but hit something like Cntrl+Z instead.

To stop the server on port 8000 so that you can run another instance again you can do the following..

Run the below command to list all your processes with 'manage' in their name.
$ ps aux | grep -i manage

Note the process_id (pid)  for our " runserver" process which should be the second column from the left.

And then simply run
$ kill -9 <pid>

e.g. $ kill -9 30144



  1. Thanks, I managed to stop my Django server.

  2. A little over four years later an this still is helping people. Thank you!

  3. how to fix python runserver error
    not run

  4. I like your blog, I read this blog please update more content on python, further check it once at python online training


Popular Posts