SlideShare une entreprise Scribd logo
1  sur  35
Télécharger pour lire hors ligne
如何⽤用Django在24⼩小時
作出prototype微創業
以petneed.me為例
jslee 2013 at PyConTW
13年6月1⽇日星期六
who am i?
• 不太會寫js 的 jslee (全端⼯工程師 ?)
• ⺫⽬目前正在創⽴立YouHack Team
• 曾經任職過的公司有台達電、D-Link、中
華電信、Yam、Yahoo!以及飛⾏行網(Kuro)
• http://jslee.name/
13年6月1⽇日星期六
Startup Weekend
Done:
• Taipei Startup Weekend
• HongKong Startup Weekend
• Tokyo Startup Weekend
Todo:
• Xiamen(廈⾨門) Startup Weekend
• And...
13年6月1⽇日星期六
13年6月1⽇日星期六
私⼈人時間
• 畢業於實踐⼤大學資管系,在學時與室友
創⽴立實踐⼤大學晨曦之星BBS
bbs.kh.usc.edu.tw。
• 在2006年創⽴立youfate.com,並靠Google
Adsense取得遊學紐⻄西蘭的資⾦金。
• 在2012年的過年假期,創⽴立petneed.me。
13年6月1⽇日星期六
契機
• 某天看到台北市政府開放資料平台
• 裡⾯面有⼀一個「開放認養動物」的json API
13年6月1⽇日星期六
⻑⾧長這樣
13年6月1⽇日星期六
13年6月1⽇日星期六
還好在下⽐比較宅有裝
chrome+json viewer
13年6月1⽇日星期六
13年6月1⽇日星期六
Why I Start Coding?
我想要看JSON裡⾯面的圖⽚片
⼀一⾴頁就看完
13年6月1⽇日星期六
In 24hours I did
13年6月1⽇日星期六
Step 0.
• Register a domain name. (10 USD)
• Get aVPS (20 USD/month)
• prepare Django development
environment (0 USD)
• 寫⼀一份完整的企劃書
• 從買份美美的 bootstrap template.(7 USD)
13年6月1⽇日星期六
Step.1
• 百善孝為先,萬惡*為⾸首
• 先設計model準備好DB要怎麼放
13年6月1⽇日星期六
設計model
• 與其說是設計,倒不如就是把json API裡
⾯面的schema直接倒到django的model裡
13年6月1⽇日星期六
13年6月1⽇日星期六
why Django model ?
• 換DB不⽤用重寫code,SQLite/MySQL/
PostgreSQL隨便你切換
• 開發過程隨時可以增/改/刪 DB schema,
只要下syncdb就能⾺馬上同步
• 操作DB schema像是操作物件
• 聽說跟Ruby on Rails很像
13年6月1⽇日星期六
step 2.
• 需要⼀一個crontab job每天去pull json-API
then insert to model
13年6月1⽇日星期六
django-admin
commands
• 原本是要⽤用django-cron套件
• 多⽅方⽐比較後還是⽤用 custom django-admin
command + crontab最⽅方便
13年6月1⽇日星期六
Crontab Job? django ?
13年6月1⽇日星期六
custom django-admin
command
13年6月1⽇日星期六
放在哪?
13年6月1⽇日星期六
如何寫?
13年6月1⽇日星期六
update_animal.sh
13年6月1⽇日星期六
crontab
• 9 * * * * /home/ail/mydev/pets/cronjob/
update_animal_data.sh >/dev/null 2>&1
13年6月1⽇日星期六
縮圖 by PTL
13年6月1⽇日星期六
compress js/css
•django_compressor
13年6月1⽇日星期六
把
13年6月1⽇日星期六
變
13年6月1⽇日星期六
that’s it!
• 沒了
• 只有24⼩小時這是極限了~
13年6月1⽇日星期六
但是
13年6月1⽇日星期六
結論
• 太陽都下⼭山了,有夢想就趕快實做
• YouHack Team 徵⼈人中
• connect me: jslee@youhack.com
• or meet me Face2Face :)
13年6月1⽇日星期六
謝謝
Thanks
ありがとう
13年6月1⽇日星期六
Q&A
13年6月1⽇日星期六
petneed.me
13年6月1⽇日星期六

Contenu connexe

Plus de JS Lee

Vip-check-in App 解說 中文版
Vip-check-in App 解說 中文版Vip-check-in App 解說 中文版
Vip-check-in App 解說 中文版JS Lee
 
Vip check in_app_tour
Vip check in_app_tourVip check in_app_tour
Vip check in_app_tourJS Lee
 
宠幸 Pet's GPS Necklace
宠幸 Pet's GPS Necklace宠幸 Pet's GPS Necklace
宠幸 Pet's GPS NecklaceJS Lee
 
Fabric
FabricFabric
FabricJS Lee
 
Python coding style guild 19 Langue Rule 17 Style Rule
Python coding style guild 19 Langue Rule 17 Style RulePython coding style guild 19 Langue Rule 17 Style Rule
Python coding style guild 19 Langue Rule 17 Style RuleJS Lee
 
Code review on github training ( intermediate )
Code review on github training ( intermediate )Code review on github training ( intermediate )
Code review on github training ( intermediate )JS Lee
 
Code review on github training ( beginner )
Code review on github training ( beginner )Code review on github training ( beginner )
Code review on github training ( beginner )JS Lee
 
Mysql cluster
Mysql clusterMysql cluster
Mysql clusterJS Lee
 
MVC in Codelgniter
MVC in Codelgniter MVC in Codelgniter
MVC in Codelgniter JS Lee
 

Plus de JS Lee (9)

Vip-check-in App 解說 中文版
Vip-check-in App 解說 中文版Vip-check-in App 解說 中文版
Vip-check-in App 解說 中文版
 
Vip check in_app_tour
Vip check in_app_tourVip check in_app_tour
Vip check in_app_tour
 
宠幸 Pet's GPS Necklace
宠幸 Pet's GPS Necklace宠幸 Pet's GPS Necklace
宠幸 Pet's GPS Necklace
 
Fabric
FabricFabric
Fabric
 
Python coding style guild 19 Langue Rule 17 Style Rule
Python coding style guild 19 Langue Rule 17 Style RulePython coding style guild 19 Langue Rule 17 Style Rule
Python coding style guild 19 Langue Rule 17 Style Rule
 
Code review on github training ( intermediate )
Code review on github training ( intermediate )Code review on github training ( intermediate )
Code review on github training ( intermediate )
 
Code review on github training ( beginner )
Code review on github training ( beginner )Code review on github training ( beginner )
Code review on github training ( beginner )
 
Mysql cluster
Mysql clusterMysql cluster
Mysql cluster
 
MVC in Codelgniter
MVC in Codelgniter MVC in Codelgniter
MVC in Codelgniter
 

Petneedme