The web application
As with the previous chapter, the web application that controls the servos is built using the Flask framework and served using Nginx and Gunicorn. Hence, the deployment procedure will be very similar here:
First, we must ensure that the Raspbian installation is up to date and install the packages that we need to deploy on the web application:
sudo apt-get update sudo apt-get upgrade sudo apt-get install python-pip git python-dev gunicorn supervisor nginx swig libasound-dev sudo pip install RPIO
Next, we will clone the code repository for the MIDI parsing library that will be used to read MIDI files and then install it using Python setup tools:
git clone https://github.com/vishnubob/python-midi.git cd python-midi sudo python setup.py install cd
Next, we will clone the code repository for the Flask framework and install it using Python setup tools:
git clone https://github.com/mitsuhiko/flask.git cd flask sudo python setup.py install cd
Next, we will copy the Nginx configuration...