Serving Flask helloworld using uwsgi

uwsgi is a high performance, low-resource usage web server for deploying python application.

In this post, i am going to show how to serve a simple HelloWorld application in flask using uwsgi



pip install flask 

pip install uwsgi

Now lets create our

from flask import Flask
app = Flask(__name__)

def hello():
    return "Hello World!"

if __name__ == "__main__":

So we have created a simple flask application. Now lets create a run file for running the application

from app import app as application
if __name__ == "__main__":

Now we need to create a .ini (uwsgi.ini) file to save the settings for serving the uwsgi

http =
chdir = /home/name/flaskuwsgi
wsgi-file =
processes = 4
threads = 2
stats =

now serve the application by running uwsgi uwsgi.ini. You can view your application at

if you wish to serve it via nginx, configure reverse proxy to the ip and port after changing the first line in uwsgi.ini to

socket =

Njoy smile