79101355

Date: 2024-10-18 09:08:43
Score: 3.5
Natty:
Report link

I had a similar problem with PyCharm FastAPI. When introducing a change, it used to get stuck on reload. (most likely couldn't kill the current process.) The server was still running on the old version, although I could see it is trying to reload.

However, I could resolve it by just using the terminal and running

uvicorn main:app --reload

It then worked like a charm.

You should not use the FastAPI launcher. Instead launch it directly by Uvicorn.

I noticed that no matter what I do in "Run/Debug Configuration" of PyCharm, it won't be fixed there. I.E. if I choose Uvicorn in "Run/Debug Config" window of PyCharm, I still face the same problem, it does not reload. For me it works only when I launch the server from the terminal using Uvicorn.

Reasons:
  • Blacklisted phrase (1): worked like a charm
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): face the same problem
  • Low reputation (1):
Posted by: AdmWinther