重新启动django runserver时如何清除端口 [英] How to 'clear' the port when restarting django runserver

查看:149
本文介绍了重新启动django runserver时如何清除端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,当重新启动Django runserver时,如果我使用相同的端口号,我得到一个'端口已经在使用'的消息。随后,我需要每次增加端口号以避免这种情况。



然而,在所有服务器上并不是这样,所以我想知道我可以如何实现在我正在工作的当前系统上?



BTW,平台是Ubuntu 8.10

解决方案

获取该消息,因为服务器已经在运行(可能在后台)。确保杀死进程(将其带到前台并按ctrl-c)停止进程。


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 time to avoid this.

It's not the case on all servers, however, so I'm wondering how I might achieve this on the current system that I'm working on?

BTW, the platform is Ubuntu 8.10

解决方案

You're getting that message because the server is already running (possibly in the background). Make sure to kill the process (bring it to the foreground and press ctrl-c) to stop the process.

这篇关于重新启动django runserver时如何清除端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆