Django Webfaction 'Timeout when reading response headers from daemon process'

后端 未结 4 500
南方客
南方客 2020-12-14 17:59

My Django app on my production server hosted on Webfaction was working fine until I just tried to restart it after pushing a change to the settings.py file. I ran

         


        
相关标签:
4条回答
  • 2020-12-14 18:22

    In my case (Python 3.6), the mimetypes module caused this problem. I did not further investigate this, but removing a call to mimetypes.guess_type solved the problem. The call was made in the related Django view function.

    0 讨论(0)
  • 2020-12-14 18:23

    Try increasing Timeout directive in httpd.conf, which defaults to 60 seconds in Apache 2.4. For example:

    TimeOut 600
    
    0 讨论(0)
  • 2020-12-14 18:33

    Python C extension modules, like numpy, are known to cause timeouts when used under mod_wsgi. There's a clear explanation of the problem (direct from the author of mod_wsgi) available at https://serverfault.com/a/514251/109598

    If that sounds like it might be the cause of your problem, then the solution is probably simple - add the following to your httpd.conf:

    WSGIApplicationGroup %{GLOBAL}
    

    Be sure to restart your Apache instance after making that change.

    0 讨论(0)
  • 2020-12-14 18:41

    Here is how I was able to find the root cause of my issue.

    python manage.py showmigrations
    

    My app could not reach the database server, so it would eventually time out. Running manage.py I could see see the error message on the console.

    0 讨论(0)
提交回复
热议问题