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
0
120
Flask - O pequeno príncipe
Diego Toral
December 12, 2015
Tweet
Share
Other Decks in Programming
See All in Programming
Laravel OpenAPIによる"辛くない"スキーマ駆動開発
kentaroutakeda
2
2.1k
せっかくモデル図描くのなら、嬉しいことが多い方がいいよね!
kuboaki
1
1.7k
デザインシステムで Tailwind CSSとCSS in JSに分散投資をしたら良かった話
fsubal
14
3.2k
MySQL のインデックスの種類をおさらいしよう! / overviewing indexes in MySQL
okashoi
0
170
PHP 8.3で追加されたjson_validate()を徹底的に深掘りしてみよう
mashirou1234
1
720
プロンプトエンジニアリング入門
tomokusaba
2
970
「コンパイル時のユニットテスト」導入するとユニットテストを 書かなくてよくなるのか?
tomohisa
9
2.2k
TCA魔法学入門🪄
dazy
0
280
上手な探索的テストとその上達方法について
matsu802
4
650
とにかくHTTP3をライトニングに話す / Anyway, I'll talk to Lightning about HTTP3.
seike460
PRO
0
120
クソコード動画『カプセル化 Mk-II』 で考える 上手くカプセル化できない理由 / encapsulation2
minodriven
11
7.8k
ここ1~2年くらいで 使えるようになった(主要ブラウザーの最新版 がすべて対応した ) ウェブの新機能について ランダムに喋る!
myzkyy
9
6.5k
Featured
See All Featured
Writing Fast Ruby
sferik
619
59k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
[RailsConf 2023] Rails as a piece of cake
palkan
21
3.8k
10 Git Anti Patterns You Should be Aware of
lemiorhan
644
57k
A better future with KSS
kneath
230
16k
Web development in the modern age
philhawksworth
201
10k
Docker and Python
trallard
33
2.6k
Fontdeck: Realign not Redesign
paulrobertlloyd
75
4.8k
Keith and Marios Guide to Fast Websites
keithpitt
407
22k
No one is an island. Learnings from fostering a developers community.
thoeni
14
2k
Infographics Made Easy
chrislema
237
18k
Product Roadmaps are Hard
iamctodd
43
9.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