Flask - WSGI process continues to fail

I get weird errors when trying to deploy Flask application (v0.8). I use apache mod_wsgi, as suggested in the docs (almost to the letter). Which is strange in some requests (just access to / through the browser), the application loads fine, but very often I get resource loading errors (I can’t get some css or images), and the error log shows something like Premature end of script headers: myapp.wsgi . Sometimes apache crashes with an internal server error . I am trying to pursue a problem, but I can not understand what is the reason. My wsgi file looks simple:

 from myapp import app as application 

Any clues to start looking for?

0
source share
1 answer

If you get an invalid end to the script headers, you are using daemon mode and the daemon process is crashing with a seg error or similar.

Make sure you are not loading mod_python yet.

Also try installing:

 WSGIApplicationGroup %{GLOBAL} 

to work around issues with Python C extension modules that are unsafe for sub-interpreters.

Cm:

http://code.google.com/p/modwsgi/wiki/ApplicationIssues

and find the various reasons for the failures listed.

+3
source

Source: https://habr.com/ru/post/1401251/


All Articles