Deploying Flask application with uwsgi and nginx Deploying Flask application with uwsgi and nginx flask flask

Deploying Flask application with uwsgi and nginx


It doesn't matter how complex your application is. You tell uWSGI where the entry is, the rest is processed normally with Python imports.

In your case the entry is module = %(app) and callable = app. So uWSGI will load the module and send requests to the callable which is a Flask application.

Now since the requests are to be served by uWSGI and not Flask's server, you don't need the app.run(debug = False) line. But you can keep development and production code the same with this trick:

#!flask/bin/pythonfrom app import appif __name__ == "__main__":    app.run(debug = False)