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
190
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
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
6.9k
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
1
3.1k
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
470
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
200
【やさしく解説 設計編 #1】「ドメイン駆動」と「実装駆動」ってなに? 〜設計の考え方を、たとえ話で学ぼう〜
panda728
PRO
1
140
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
180
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
120
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
540
型も通る、synthも通る、それでも危ない 〜AIのCDKの権限とコストを機械で検証する〜 / It Passes Type Checks, It Passes Synth Checks, but It’s Still Risky — Automatically Verifying Permissions and Costs in AI’s CDK —
seike460
PRO
1
440
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
350
광주소프트웨어마이스터고등학교 DevFest 특강 - 바이브 코딩 시대에서 주니어 개발자로 살아남는 방법
utilforever
1
150
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
560
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
350
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.9k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
230
The untapped power of vector embeddings
frankvandijk
2
1.8k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.7k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Design in an AI World
tapps
1
270
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
980
Code Review Best Practice
trishagee
74
20k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
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