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
Sipping from a Flask
Search
Nick DiRienzo
February 02, 2013
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Sipping from a Flask
A short and noobish talk on Flask. Given at BarCamp Buffalo Spring 2013.
Nick DiRienzo
February 02, 2013
Transcript
17 slides
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?
More Decks by Nick DiRienzo
See All by Nick DiRienzo
How Optimizely scaled its REST API with asyncio
nickdirienzo
0
220
How to communicate effectively with the young people of today
nickdirienzo
0
47
Let's Talk Facebook
nickdirienzo
0
70
Go Code! (and other things)
nickdirienzo
1
83
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Thoughts on Productivity
jonyablonski
76
5.5k
Testing 201, or: Great Expectations
jmmastey
46
8.4k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
560
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
700
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
61k
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
580
Being A Developer After 40
akosma
PRO
92
590k
Music & Morning Musume
bryan
48
7.5k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.5k