Python的Web框架 Bottle
一個Python Web框架,整個框架只有一個文件,幾十K,卻自帶了路徑映射、模板、簡單的數據庫訪問等web框架組件,確實是個可用的框架。初學web開發可以拿來玩玩,其語法簡單,部署也很方便。
- Routing: Requests to function-call mapping with support for clean and dynamic URLs.
- Templates: Fast and pythonic built-in template engine and support for mako, jinja2 and cheetah templates.
- Utilities: Convenient access to form data, file uploads, cookies, headers and other HTTP-related metadata.
- Server: Built-in HTTP development server and support for paste, fapws3, bjoern, Google App Engine, cherrypy or any other WSGI capable HTTP server.
示例代碼:
from bottle import route, run@route('/:name')
def index(name='World'):
return ' Hello %s!' % name
run(host='localhost', port=8080)
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!