Question
No python application found - uWSGI + Flask + nginx
After following this tutorial to set up flask on nginx and uwsgi (https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-14-04) on Ubuntu 14.04, I managed to get the simple app to work, however when I replace my app with it (with the same name), I’m getting an internal server error. At first this was due to the modules, but this persisted after installing all required modules.
Logging uwsgi it says “no python application found, check your startup logs for errors”.
My python file (portal.py):
app = Flask(__name__, static_folder='static', static_url_path='/static')
app.secret_key = 'askaj3432sd'
app.config.update(
DEBUG=True,
PROPAGATE_EXCEPTIONS=True)
if __name__ == "__main__":
app.run(threaded=True, host='0.0.0.0')
My wsgi.py:
from portal import app
if __name__ == "__main__":
app.run()
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
I’m having the same issue. Would appreciate someone looking at this.
try changing
to
This worked for me.
Not sure why import app does not work. As far as I can see it does not conflict with anything in wsgi?