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
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Music & Morning Musume
bryan
48
7.4k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
630
Code Review Best Practice
trishagee
74
20k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
Utilizing Notion as your number one productivity tool
mfonobong
4
620
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
580
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
990
Optimising Largest Contentful Paint
csswizardry
37
4k
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でビルドされたモジュールが使える