r/Python • • Dec 21 '10

The Bottle Web Micro-framework

http://www.tummy.com/journals/entries/jafo_20101221_020135
43 Upvotes

45 comments sorted by

View all comments

10

u/Siraf Dec 21 '10

I was happily using bottle for a while until I discovered flask . I found flask to have better documentation and better support for important middleware features, such as csrf protection and session-support. Flask also uses decorators for routing / templates.

I do like bottle for its cgi support, however.

9

u/mdipierro Dec 22 '10 edited Dec 22 '10

Joke: Damn flask people injecting in every bottle thread!

A quick check reveals (only core *.py files).

  • Bottle: 1938 (lines of code, 1 file only)

  • Flask (including dependencies Jinja2, Werkzeug, not including tests, debug, apps, contrib): 24179 (lines of code)

  • web2py (not including tests, apps, contrib, database abstraction layer but including templates, html helpers, form generation and processing libraries, and syntax highligther and all handlers) 23469 (lines of code)

For people who want a MICRO framework. I think Bottle wins by one order of magnitude.

EDIT: Before touchy people jump up and down: I added web2py as a reference point. I am not comparing it with Bottle and Flask. I am not saying it is a micro framework. If I had Django or Pylons installed I would have added them as reference points too (I would not know how to separate the ORM). Perhaps other redditors can contribute numbers and verify mine.

3

u/ericflo Dec 22 '10

The difference is that he was responding to someone else who brought up Flask, yet you independently brought up web2py.

-1

u/mdipierro Dec 22 '10

What are you talking about? First of all I made a Joke. Second, who is "he" in your post? Third, both Siraf and bobx11 brought up Flask in this thread without "responding to someone else".

Since you are here, you could contribute with some useful information: how big is Django without orm, apps, and contrib?