Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Pythonの高速軽量フレームワーク
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
shimakaze-git
January 12, 2019
270
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Pythonの高速軽量フレームワーク
shimakaze-git
January 12, 2019
More Decks by shimakaze-git
See All by shimakaze-git
DjangoとFastAPIによる 実践認証技術
shimakaze_soft
0
1.3k
フロントエンドとバックエンドのコミュニケーションをスムーズにするスキーマ駆動開発
shimakaze_soft
2
600
クリーンアーキテクチャのリポジトリパターン - Pythonでの実装
shimakaze_soft
1
6.4k
lt20221030.pdf
shimakaze_soft
0
190
Dependabotを使って 運用しているおはなし
shimakaze_soft
0
2.3k
DjangoCongressJP 2019/2020 & 今年にPyConJP初登壇できたはなし
shimakaze_soft
0
480
GAEによるPythonWEBアプリケーションの高速開発
shimakaze_soft
0
3.3k
FlaskとDjango以外のAPI開発の選択肢
shimakaze_soft
0
550
Python で Dependency Injection(DI) をやるには?
shimakaze_soft
1
3.9k
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
530
Music & Morning Musume
bryan
48
7.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
630
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Visualization
eitanlees
153
17k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.2k
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Transcript
Pythonの高速軽量フレームワーク
- Python, PHP, Node - Backend, Infrastructure - Twitter(@shimakaze_soft) -
GitHub(shimakaze-git) - Note(shimakaze_soft) @shimakaze_soft
こんな人にオススメの内容 Q.PythonのWEBアプリケーション開発事情について少し知りたい Q.FlaskとDjango以外の開発知見について少し知りたい A. Flaskについて軽く触れます
こんな人にオススメの内容 Q. お前にマサカリを投げてやりたい A. お手柔らかにお願いいたします
Python界の二台巨頭WEBフレームワーク - Flask フラスク(読み) - 軽量フレームワーク - ASGI - 学習コスト(低)
- Django ジャンゴ(読み) - フルスタックフレームワーク - ASGI - 学習コスト(中 〜 高)
- Django - Flask - Pyramid - Bottle - Tornade
- Responder - Sanic いろんなWEBフレームワークあるけどあんまり普及していない
Djangoの使い道 - 本格的なWEBアプリケーショの開 発 - フロントとバックエンドも一括でや りたい際 - (余談) InstagramとCompassは
Django製
Flaskの使い道 - ちょっとした検証用のプロダクトを 作る際 - 機械学習エンジン(分類器)などを 作る際 - PythonでWEBをやる際の入門?
APIを開発する場合の選択肢は?(Django) フロントとバックエンドを完全分離する場合 Djangoを使用する - DjangoでAPI開発のためのDjango RestFramework(DRF)というのがあるけど、 学習コストがかなり高い - Django自体そこまでパフォーマンスが速いわけではないので、API用途でわざわざ 使う意味がある?
APIを開発する場合の選択肢は?(Flask) フロントとバックエンドを完全分離する場合 Flaskを使用した場合 - パフォーマンスが遅い - 設計でディレクトリ分けをちゃんとやらないとカオスになる - フレームワーク単体の機能が少ないので、サードパーティーをうまく組み合わせる 必要がある
- Flaskは開発者のmitsuhiko氏がRustに開発の軸足を移し始めて、衰退傾向?
Flaskの簡単なコード from flask import Flask, jsonify, make_response, request app =
Flask() @app.route("/hello") def hello_to(): foo = request.args.get("foo", "") body = jsonify({ "Hello": “Hello”, }) resp = make_response(body, 200) return resp @app.route("/hello/<test>") def hello_to(test): foo = request.args.get("foo", "") body = jsonify({ "Hello": test, }) resp = make_response(body, 200) return resp 開発していくとコードが肥 大化して読みづらくなって くる
API用途に最適なフレームワーク(Falcon) - パフォーマンスはFlaskの20倍 - Hook, Middlewareという機能が標準で備 えられている - Cythonでビルドすると更に高速化されるよ うに設計されている
- RESTのアーキテクチャスタイルを取り入 れいている サンプルコード類 https://github.com/shimakaze-git/falcon-todo
falcon 3.0が2019年以内に出るよ Falcon3.0が4~6月にリリースされる予定 - 非同期処理を標準でサポート - 初期時にCythonでビルドされたモジュールが使える