Flask/開発環境

コマンドライン
pip install flask
	
Python
from flask import Flask

app = Flask(__name__)

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


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

#127.0.0.1:80
#localhost:80
ディレクトリ
htmlファイル: templatesディレクトリに配置
CSS,JavaScriptファイル: staticディレクトリに配置
	
python
from flask import Flask, render_template

app = Flask(__name__)


@app.route('/')
def index():
    return render_template('index.html')


if __name__ == '__main__':
    app.debug = True
    app.run(host='0.0.0.0', port=88)
html
head>
    link rel="stylesheet" href="{{url_for('static', filename='index.css')}}">
    script src="{{url_for('static', filename='index.js')}}">/script>
/head>