August 2017
Intermediate to advanced
278 pages
8h 53m
English
This recipe is based on a very simple, single file Flask application. To show the simplicity, here's the example (demoapp.py) we'll use:
from flask import Flask
application = Flask(__name__)
@application.route("/")
def hello():
return "<h1>Demo via Nginx with uWSGI!</h1>"
if __name__ == "__main__":
application.run(host='127.0.0.1', port=9001)
Like the Django recipe, we're going to use uWSGI for the application server in this scenario as well. If you haven't installed uWSGI yet, the best way is to install the latest version via pip:
apt-get install python-pip python-devpip install uwsgi
Read now
Unlock full access