Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Sipping from a Flask
Search
Nick DiRienzo
February 02, 2013
0
170
Sipping from a Flask
A short and noobish talk on Flask. Given at BarCamp Buffalo Spring 2013.
Nick DiRienzo
February 02, 2013
Tweet
Share
More Decks by Nick DiRienzo
See All by Nick DiRienzo
How Optimizely scaled its REST API with asyncio
nickdirienzo
0
210
How to communicate effectively with the young people of today
nickdirienzo
0
41
Let's Talk Facebook
nickdirienzo
0
64
Go Code! (and other things)
nickdirienzo
1
73
Featured
See All Featured
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
710
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
100
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
37k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
170
ラッコキーワード サービス紹介資料
rakko
1
2.3M
Prompt Engineering for Job Search
mfonobong
0
160
Leo the Paperboy
mayatellez
4
1.4k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
94
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
1.9k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
93
Deep Space Network (abreviated)
tonyrice
0
48
Transcript
Sipping from a Flask
@nickdirienzo UB ACM UB Hacking
ASSUMING Python: pip, virtualenv HTTP methods PostgreSQL
FLASK Microframework Flexible
LET’S GO mkdir todo && cd todo virtualenv venv --distribute
source venv/bin/activate pip install flask
app.py import flask app = flask.Flask(__name__) @app.route(‘/’) def index(): return
‘hai’ if __name__ == ‘__main__’: app.run()
DAMN GOOD DRANK
python app.py
TEMPLATING mkdir templates cd templates Jinja2 or whatever
index.html <!doctype> <html> <head> <title>Todos</title> </head> <body> <p>Hey you!</p> </body>
</html>
app.py @app.route(‘/’) def index(): return flask.render_template(‘index.html’)
app.py @app.route(‘/’) def index(): if ‘name’ in flask.request.args: name =
flask.request.args[‘name’] else: name = ‘Buffalo’ return flask.render_template(‘index.html’, name=name)
index.html <!doctype> <html> <head> <title>Todos</title> </head> <body> <p>Hey {{ name
}}!</p> </body> </html>
Still Learning ORM Third-party Modules Blueprints
Deploy App Engine DIY Heroku
Todo
Questions?