Bottle Intro @ Tainan.py 2013.6.14

Preview:

DESCRIPTION

歡迎加入 Tainan.py: http://www.meetup.com/Tainan-py-Python-Tainan-User-Group/ -- 其實我的投影片都放在 speakerdeck: https://speakerdeck.com/excusemejoe

Citation preview

... 先不談 Django

Joe @ Tainan.py 2013.6.14

你聽過 Bottle 嗎?

今天真的不會提到 Django!

Let's talk about Bottle today:

Part 1: About me

Part 2: Bottle basic

Part 3: Bottle + gevent

Part 4: My sad story

Part 5: Conclusion

Part 1: About me

Joe應該算是文字工作者

平常用 Vim ...

PyConTw 2013 Volunteer

Python newer (1.5 year)

Work at startup:

My blog

Part 2: Bottle basic

Author

Author

Following RFC ... 德國人無誤 Good Job!!

Progress

• 2009 ~ 2013

• Always single file

• Always no dependencies other than STD

• Always lack of ORM, session management support ...

• Source code: around 1000+ ~ 3000+

Applications

• Blog, chat room, any small web app ...

• Good at providing API service

• Good performance

• Good for experimental service

Who use it ?

Rank

Documentations

Before Tutorial

Tutorial

• sudo pip install bottle

• Features

• WSGI, Single files, Use STD only ....

• Routing

• Templates

• Build-in Server

• Utilities for http-related access

Tutorial - hello world

Go to Official Website !

Tutorial - routing

Tutorial - static files

Tutorial - redirect

Tutorial - error pages

Tutorial - IO

Tutorial - cookies ...

Tutorial - file upload

Tutorial - WSGI

Tutorial - templates

Tutorial - plugins

Tutorial - others ...

Tutorial - more...

Go to Official Website or Blog !!

Part 3: Bottle + gevent

Gevent

Go to stieglitz.github.com/gevent-tutorial/

Run gevent server

Part 4: My sad story

Bottle and me

• One year ... experience

• API server

• FakeAPI server

• Piposea

• Pipostv (web + iOS)

• Memory millionaire (web + iOS)

怎麼使用 Bottle 開發的服務都死光光了 XD !

Bottle and me

• Reasons:

思維不夠 Bottle ...創業問題 ... 之後再來聊聊 ...

Bottle and me

• Now:

Simple API server ... Good

Simple web app ... Good

Complex app ... Not good, but possible

How ?

Larger Bottle

Larger Bottle

Larger Bottle

Use python decorator, too ...

Larger Bottle

Larger Bottle

Larger Bottle

Larger Bottle

Larger Bottle

Larger Bottle

Part 5: Conclusion

工商服務

• PyconTW 2013 (有教學課程)

敝公司徵才中...誰來教我寫前端啊 ... Orz

Recommended