How to Make uWSGI die when it encounters an error?
<p>I have my Python app running through uWSGI. Rarely, the app will encounter an error which makes it not be able to load. At that point, if I send requests to uWSGI, I get the error <code>no python application found, check your startup logs for errors</code>. What I would like to happen in this situation is for uWSGI to just die so that the program managing it (Supervisor, in my case) can restart it. Is there a setting or something I can use to force this?</p>

<p>More info about my setup:
Python 2.7 app being run through uWSGI in a docker container. The docker container is managed by Supervisor, and if it dies, Supervisor will restart it, which is what I want to happen.</p>

<p>After an hour of searching, I finally found a way to do this. Just pass the <code>--need-app</code> argument when starting uWSGI, or add <code>need-app = true</code> in your .ini file, if you run things that way. No idea why this is off by default (in what situation would you ever want uWSGI to keep running when your app has died?) but so it goes.</p>

python uwsgi supervisord