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
180
0
Share
Sipping from a Flask
A short and noobish talk on Flask. Given at BarCamp Buffalo Spring 2013.
Nick DiRienzo
February 02, 2013
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
42
Let's Talk Facebook
nickdirienzo
0
66
Go Code! (and other things)
nickdirienzo
1
75
Featured
See All Featured
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
260
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
250
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
230
The untapped power of vector embeddings
frankvandijk
2
1.7k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Being A Developer After 40
akosma
91
590k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
190
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
220
So, you think you're a good person
axbom
PRO
2
2k
30 Presentation Tips
portentint
PRO
1
270
Paper Plane (Part 1)
katiecoart
PRO
0
6.3k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
450
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?