Book Image

Raspberry Pi Blueprints

Book Image

Raspberry Pi Blueprints

Overview of this book

Table of Contents (17 chapters)
Raspberry Pi Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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:

  1. 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
    
  2. 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
    
  3. 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
    
  4. Next, we will copy the Nginx configuration...