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
Flask Lighting Talk
Search
Armin Ronacher
June 12, 2010
Programming
620
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Flask Lighting Talk
At DjangoCon.eu 2010
Armin Ronacher
June 12, 2010
More Decks by Armin Ronacher
See All by Armin Ronacher
Reflections on building cloud and local hybrid machine entities
mitsuhiko
1
260
Agentic Coding: The Future of Software Development with Agents
mitsuhiko
0
1k
Do Dumb Things
mitsuhiko
0
1.1k
No Assumptions
mitsuhiko
0
480
The Complexity Genie
mitsuhiko
0
370
The Catch in Rye: Seeding Change and Lessons Learned
mitsuhiko
0
470
Runtime Objects in Rust
mitsuhiko
0
470
Rust at Sentry
mitsuhiko
0
640
Overcoming Variable Payloads to Optimize for Performance
mitsuhiko
0
340
Other Decks in Programming
See All in Programming
JIS keyboard support in Omarchy
lef237
0
180
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
150
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
120
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
120
Getting Started with Vibe Coding
miccheng
0
180
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
2.2k
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
200
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
330
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
270
Groovy as a human and AI friendly programming language
paulk
0
180
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
320
GraphQL の onError と Nullability のこれから
quramy
0
210
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
22k
A Soul's Torment
seathinner
8
3.9k
Music & Morning Musume
bryan
48
7.5k
How STYLIGHT went responsive
nonsquared
100
6.4k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
970
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
550
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
970
30 Presentation Tips
portentint
PRO
1
460
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.4k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Transcript
a gentle introduction into a microframework with good intentions {
Armin Ronacher – http://lucumr.pocoo.org – http://twitter.com/mitsuhiko }
What is Flask? » A microframework » Reusing existing code
» Lots of documentation » Neat way to write small apps
Another µFramework? YES!
Under the Hood » Full power of Werkzeug » Jinja2
as a capable template engine
Under the Hood » 450 Lines of actual Code »
1000 Lines of Tests » 5000 Lines of Documentation
What does it do? » Cookie-based session support » Flashing
of messages » Preconfigured Jinja2 with autoescaping » Serves static files from “static” » Before/After Request hooks » Context local objects » RESTful URL mapping
What else? » Lots of documentation (120 A4 pages) »
Website with lots of snippets » Extension registry (OAuth, OpenID, XML- RPC, CSRF protection …) » Active Mailinglist and IRC Channel
Hello Flask from flask import Flask app = Flask(__name__) @app.route('/')
def index(): return 'Hello World!' if __name__ == '__main__': app.run(debug=True)
Hello Localhost $ python hello.py * Running on http://127.0.0.1:5000/ *
Restarting with reloader...
Rendering Templates from flask import render_template @app.route('/') def index():
return render_template('index.html', variable='value' )
The Request Data from flask import request, flash, redirect, \
url_for, request @app.route('/new-‐comment', methods=['GET', 'POST']) def new_comment(): if request.method == 'POST': Comment(request.form['name'], request.form['text']).save() flash('Comment was added') return redirect(url_for('show_comments')) return render_template('new_comment.html')
Before/After Request import sqlite3 from flask import g @app.before_request def
before_request(): g.db = sqlite3.connect(…) @app.after_request def after_request(response): g.db.close() return response
If Things Break
Where to get? $ pip install Flask http://github.com/mitsuhiko/flask http://flask.pocoo.org/