已解決:code%3DH18 desc%3D%22Server Request Interrupted%22 django

核心.exceptions.Http404

請求被服務器錯誤中斷。

-admin.py runserver

If you are running Django on a development server and you get an error code that says "Server Request Interrupted", it means that the server was unable to process your request. This can happen for a number of reasons, including if the server is overloaded or if there is an error in your code.

Heroku Django Gunicorn 錯誤 H18

當嘗試使用 Gunicorn 服務器將 Django 應用程序部署到 Heroku 時,可能會發生此錯誤。 該錯誤通常是由於缺少對 psycopg2 庫的依賴項造成的。

要解決此問題,您可以使用以下命令在您的 Heroku 實例上安裝 psycopg2:

$ heroku 插件:添加 python-psycopg2

安裝 psycopg2 後,您可以使用以下命令重新部署 Django 應用程序:

$ heroku 部署 –app my-django

請求中斷

當 Django 中的請求被中斷時,請求對像被設置為 None 。 這意味著請求已被取消,不會對其進行進一步處理。

如果你想繼續處理請求,你應該再次調用 process_request()。

調試“H18 服務器請求中斷”錯誤

在 Django 中調試“H18 服務器請求中斷”錯誤可能很困難。 這些錯誤的最常見原因是等待 H18 服務器響應時超時。 為了調試這些錯誤,您需要確定超時的來源並努力解決它。

相關文章:

發表評論