# Server still on inspite of terminating / shutting down PyCharm

**URL:** <https://forum.djangoproject.com/t/server-still-on-inspite-of-terminating-shutting-down-pycharm/24943>\
**Category:** Mystery Errors\
**Created:** [November 1, 2023, 5:06am UTC](https://forum.djangoproject.com/t/server-still-on-inspite-of-terminating-shutting-down-pycharm/24943 "2023-11-01T05:06:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anjanesh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anjanesh/32/4583_2.png) [@anjanesh](https://forum.djangoproject.com/u/anjanesh)\
**Post date:** [November 1, 2023, 5:06am UTC](https://forum.djangoproject.com/t/server-still-on-inspite-of-terminating-shutting-down-pycharm/24943/1 "2023-11-01T05:06:50Z")

</div>

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.

Daphne

Where is this still on in the background ?

---

<div class="post-metadata">

**Author:** ![addwebsolution](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/addwebsolution/32/23762_2.png) [@addwebsolution](https://forum.djangoproject.com/u/addwebsolution)\
**Post date:** [November 1, 2023, 5:40am UTC](https://forum.djangoproject.com/t/server-still-on-inspite-of-terminating-shutting-down-pycharm/24943/2 "2023-11-01T05:40:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anjanesh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anjanesh/32/4583_2.png) [@anjanesh](https://forum.djangoproject.com/u/anjanesh)\
**Post date:** [November 1, 2023, 9:11am UTC](https://forum.djangoproject.com/t/server-still-on-inspite-of-terminating-shutting-down-pycharm/24943/3 "2023-11-01T09:11:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [November 1, 2023, 10:28am UTC](https://forum.djangoproject.com/t/server-still-on-inspite-of-terminating-shutting-down-pycharm/24943/4 "2023-11-01T10:28:43Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![anjanesh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anjanesh/32/4583_2.png) [@anjanesh](https://forum.djangoproject.com/u/anjanesh)\
**Post date:** [November 1, 2023, 11:14am UTC](https://forum.djangoproject.com/t/server-still-on-inspite-of-terminating-shutting-down-pycharm/24943/5 "2023-11-01T11:14:21Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [November 1, 2023, 12:39pm UTC](https://forum.djangoproject.com/t/server-still-on-inspite-of-terminating-shutting-down-pycharm/24943/6 "2023-11-01T12:39:20Z")

</div>

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.
