Book Image

Raspberry Pi Embedded Projects Hotshot

Book Image

Raspberry Pi Embedded Projects Hotshot

Overview of this book

Table of Contents (20 chapters)
Raspberry Pi Mechatronics Projects HOTSHOT
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Installation of the Flask framework


In this task, we will install the Flask framework on the Raspberry Pi and complete a test web page on the Raspberry Pi. We will use the Flask framework to control the RGB LED strip.

Prepare for lift off

In the previous projects, we installed python module installers such as pip or easy_install. If either of these tools isn't installed, they can be installed by executing the following command:

sudo apt-get install python-pip

Alternatively, you can use the following command:

sudo apt-get install python-setuptools.

Next, we will work on installing the Flask framework and the first example.

Engage thrusters

  1. The Flask framework is installed using the following command:

    sudo easy_install flask
    
  2. Once the installation is complete, we will use an example available from the Flask framework documentation (http://flask.pocoo.org/docs/0.10/quickstart/#quickstart) and create a Python script (using Python IDLE's editor):

    from flask import Flask
    app = Flask(__name__)
    
    @app...