4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Flaskチュートリアル(インストールからhello worldまで)

Posted at

はじめに

FlaskでHello worldをするための、備忘録です。

作業ディレクトリの作成

mkdir flask-tutorial
cd flask-tutorial

Pythonの仮想環境作成 & アクティベート

python3 -m venv venv
source venv/bin/activate

Flaskのインストール

pip install flask
pip freeze

メインファイルの作成

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

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

if __name__ == "__main__":
    app.run(debug=True)

実行

python3 app.py
4
3
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
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?