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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
Why Our Code Smells
bkeepers
PRO
340
58k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Into the Great Unknown - MozCon
thekraken
40
2.3k
Mind Mapping
helmedeiros
PRO
0
81
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
140
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
52k
What does AI have to do with Human Rights?
axbom
PRO
0
2k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
160
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
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?