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.
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.
You get downvoted because you are needlessly aggressive with your promotion of web2py.
Stop it, you do contribute really good stuff.
Here, an upvote.
PS: Flask does compare to Bottle in simplicity. For most tasks, complexity that's completely under the hood is alright. For instance, having Apache with mod-wsgi installed wouldn't justify adding the whole Apache codebase in the comparison.
The Jinja2 and Werkzeug dependencies must be included to compare apples to apples because bottles too includes a template language, digitally signed cookies for sessions, a web server, and multiple server adapters. P.S. Actually, on this thread I am promoting Bottle!
I don't plan on removing features, lowering the quality of code or removing documentation to win an argument. So if a microframework does not depend on anything else to be called a microframework the mother of all microframeworks (camping) and the most popular Ruby one (sinatra) are not microframeworks.
I do not think there is an argument to win. I do not think you have to take anything off. I said and I repeat: I like Flask, although I do not think it is a micro-framework, at least not in the sense Bottle is. Yet it is pointless to argue on definitions. What is important is what it does and what it does not.
DasIch helped clarify things for me. Can you tell us more about the sandbox or point us to the docs?
this looks like the rexec module that was removed because broken. I think something like this (and digitally signed cookies) should be part of the standard python libraries. How about a PEP to include your code. I would support it.
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.