LoginSignup
3
4

More than 5 years have passed since last update.

[備忘録]RassberyPI Flaskインストール

Last updated at Posted at 2015-12-02

・pythonを2.7.9にする

1.ssl関連のインストール
sudo apt-get install libffi-dev libssl-dev

2.pythonのインストール

wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
tar xvf Python-2.7.9.tgz
cd Python-2.7.9/
./configure && make && sudo make install

3.pipインストール
curl -kL https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python

4.Flaskインストール
sudo pip install Flask

5.サンプル

import flask

app = flask.Flask(__name__)

@app.route('/')
def index():
    return "Hello Hogee"

if __name__ == '__main__':
    app.run(host='0.0.0.0',debug=True)

host='0.0.0.0'で、外部からアクセスできる。。

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4