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?

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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.
You may need to check your processes if something is preventing it to start
0

You can use

netstat -nltp

to check used ports.

And close or kill it using

kill -9 PID

3 Comments

Thanks I tried this but there's no process running at port 8000, also for some reason now both commands with and without the 127.0.0.1:8000 do not start the local server.
Are you using python virtualenv or venv? Maybe it's on the environment.
using virtualenv @ron_olo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.