・ Set python to 2.7.9
ssl related installation
sudo apt-get install libffi-dev libssl-dev
Install python
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
pip installation
curl -kL https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python
Flask installation
sudo pip install Flask
Sample
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)
It can be accessed from the outside with host = '0.0.0.0'
. ..
Recommended Posts