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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
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
46
Let's Talk Facebook
nickdirienzo
0
69
Go Code! (and other things)
nickdirienzo
1
81
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
570
Mind Mapping
helmedeiros
1
400
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
890
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
270
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
410
Visualization
eitanlees
153
17k
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?