How to 'clear' the port when restarting django runserver

前端 未结 19 2146
盖世英雄少女心
盖世英雄少女心 2020-12-12 11:23

Often, when restarting Django runserver, if I use the same port number, I get a \'port is already in use\' message. Subsequently, I need to increment the port number each t

19条回答
  •  借酒劲吻你
    2020-12-12 11:47

    sudo lsof -t -i tcp:8000 | xargs kill -9
    

    If you want to free 8000 port than just copy command and paste in your cmd it will ask for sudo password. And then you are good to go.

提交回复
热议问题