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
Flask - O pequeno príncipe
Search
Diego Toral
December 12, 2015
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Flask - O pequeno príncipe
Diego Toral
December 12, 2015
Other Decks in Programming
See All in Programming
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
300
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
280
Oxcを導入して開発体験が向上した話
yug1224
4
350
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
180
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
180
Oxlintのカスタムルールの現況
syumai
6
1.2k
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
7.1k
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
620
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
650
自作OSでスライド発表する
uyuki234
0
450
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.7k
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.5k
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
300
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
550
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
170
Design in an AI World
tapps
1
250
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
40k
Are puppies a ranking factor?
jonoalderson
1
3.7k
The Invisible Side of Design
smashingmag
301
52k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Transcript
O pequeno príncipe
A gente só conhece bem as coisas que cativou, disse
a raposa. - O pequeno príncipe
cativar Ficar apaixonado por; enamorar-se http://www.dicio.com.br/cativar/
Diego Toral Python and Ruby developer gh://diegotoral | fb://diegootoral |
http://diegotoral.me
vim falar sobre
framework micro
freedom estrutura ✦ banco de dados
1 from flask import Flask 2 3 app = Flask('foobar')
4 5 @app.route('/') 6 def hello(): 7 return 'Hello World!' 8 9 if __name__ == '__main__': 10 app.run() $ python hello.py * Running on http://localhost:5000/
configuração development / production $ pip install flask-environments 1 def
config_app(app): 2 env = os.getenv('FLASK_ENV', 'development') 3 app.config.from_object('foobar.config.default') 4 app.config.from_pyfile('config/%s.py' % env)
o logger app.logger.debug('A long time ago') app.logger.warning('in a galaxy far,
') app.logger.error('far away..') use
templates 1 <h1>Hello {{ name }}</h1> 2 3 {% if
with_yoda %} 4 <p>Do or do not. There is no try.</p> 5 {% endif %} +JOKB 1 from flask import Flask, render_template 2 3 @app.route('/') 4 def hello(): 5 return render_template('hello.html', name='Luke', with_yoda=True)
DADOS #"/$0de 1 from flask import Flask 2 from flask.ext.mongoengine
import MongoEngine 3 4 app = Flask(__name__) 5 db = MongoEngine(app) $ pip install flask-mongoengine 1 from flask import Flask 2 from flask_sqlalchemy import SQLAlchemy 3 4 app = Flask(__name__) 5 app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db' 6 db = SQLAlchemy(app) $ pip install flask-sqlalchemy
no mundo real
13Ó9*.04 passos ler a documentação criar algo simples se desafiar
None