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.2k
フロントエンドとバックエンドのコミュニケーションをスムーズにするスキーマ駆動開発
shimakaze_soft
2
590
クリーンアーキテクチャのリポジトリパターン - Pythonでの実装
shimakaze_soft
1
6.3k
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.8k
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
540
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
200
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
410
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Are puppies a ranking factor?
jonoalderson
2
3.9k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
240
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
The Invisible Side of Design
smashingmag
301
52k
Exploring anti-patterns in Rails
aemeredith
4
510
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
580
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でビルドされたモジュールが使える