0

Earlier when I executed,

python3 manage.py runserver

It used to start the server at my localhost http://127.0.0.1:8000/

but somehow it isnt doing so now, when I type it in now and press enter, nothing happens and the cursor just goes to the next prompt.

However if I type in,

python3 manage.py runserver 127.0.0.1:8000

It works correctly and starts the server.

What could be the issue? Is doing ctrl+C not stopping the already running server? How do I find out if I have any other servers still running in the background?

sinoroc
  • 18,409
  • 2
  • 39
  • 70
babsdoc
  • 693
  • 2
  • 11
  • 24

2 Answers2

0

If you have already running services in the background it would say that port 8000 is already in use. If for example you have started django with different port, for example:

python3 manage.py runserver 127.0.0.1:4000

and you need to check if the process is still running in the background type:

jobs

Check [this article][1] for more information. Note that if running:

python3 manage.py runserver 127.0.0.1:8000

does not throw any errors, this is not related to background jobs.

[1]: https://study.com/academy/lesson/background-processes-in-linux-definition-manipulation.html#:~:text=In%20Linux%20terminology%20(and%20in,available%20to%20execute%20other%20commands.

Zhivko Zaikov
  • 409
  • 4
  • 10
  • Thanks I tried jobs but it didn't show anything, also for some reason now both commands with and without the 127.0.0.1:8000 do not start the local server. – babsdoc Oct 04 '20 at 13:52
  • You may need to check your processes if something is preventing it to start – Zhivko Zaikov Oct 05 '20 at 07:11
0

You can use

netstat -nltp

to check used ports.

And close or kill it using

kill -9 PID
ron_olo
  • 146
  • 6