I can’t understand why I am getting a http 500 response. When I run my uwsgi server from the path that my python script is defined in, everything is perfect. As soon as I run it from another path, I get a 500 response.
Here is my uwsgi script (I set the protocol to http just for testing purposes):
/home/baz/.virtualenvs/python-flask-benchmark/bin/uwsgi
--master
--socket 127.0.0.1:3031
--pythonpath "/home/baz/Personal/Github/benchmark-node_vs_python/python"
--file "/home/baz/Personal/Github/benchmark-node_vs_python/python/app.py"
--callable app
--processes 20
--virtualenv "/home/baz/.virtualenvs/python-flask-benchmark"
--enable-threads
--protocol http
Does anyone know why? It seems like it is ignoring the --pythonpath argument.
Okay, figured it out. It was a path error whereby my application could not find a file to open. The problem was that this was not logged to Uwsgi, which was just silent. The reason was because this was a flask application, which needs to be instructed to pass all exception errors to uwsgi by doing this:
app.config['PROPAGATE_EXCEPTIONS'] = True