Server still on inspite of terminating / shutting down PyCharm

I have stopped PyCharm - closed all apps including terminal(s), except the browser but localhost:8000 still shows :

500 Internal Server Error

Exception inside application.


Where is this still on in the background ?

It happens sometimes in my system too, Following are cases when this behaviour I’ve seen

  • If you close terminal without terminating running Django server.
  • If somehow all applications closed unexpectedly.
  • If PyCharm crashes and closed by system and you start it again.

You might be seeing error that port 8000 is currently used and even all your applications are closed you might be thinking where it is actually used.

Well If I get into these behaviour I restart my system and it works.
Also In future whenever you close terminal I suggest you to first kill the server running in terminal then close it.

But I don’t get how 2 services are able to run on a single port. I thought I would have to run Daphne on a separate port.

You should (run them on different ports).

There are some OSs that will allow multiple processes to bind on the same port. (See docs on SO_REUSEADDR and SO_REUSEPORT)

Hmmmm…Im developing this django app on a Windows 11 machine and need to run this on a Ubuntu 20.04 machine.
Will it work seamlessly upon pushing the code to the server ?

That depends upon whether you’ve introduced any Windows-specific code or behavior in your system

Side note: If you’re working in Windows for a Linux deployment, I would encourage you to use WSL as your development environment. It works really well for that purpose.