问题
My Django 1.11 app (using runserver) hangs after several requests. It doesn't matter whether it's accessed by Chrome, Postman, or curl.
When it hangs, not even Ctrl+C can close it. The python.exe process must be killed.
I tried debugging it but when Django is stuck, Python cannot be paused to get the threads/stack.
回答1:
This actually happens to me due to Avast antivirus's Behavior Shield.
If you google it you find out that Avast has a long history of "hating" Python: https://www.google.co.id/search?q=avast+python
Solution: Avast > Settings > Components > Behavior Shield > Exclusions, then add your python.exe or your virtualenv's python.exe there:
来源:https://stackoverflow.com/questions/47362724/django-manage-py-runserver-hangs-after-second-request-intermittent