Hacker News new | ask | show | jobs
by schleppy_oc 4797 days ago
Straight from the horses mouth:

The big difference is that Flask is based on other technologies such as Werkzeug and Jinja2 that exist for a longer time and it does not try to reinvent things. Bottle on the other hand tries to stick to the one-file approach. I want to merge them but the Bottle developer does not seem to be very happy about the idea of stepping away from the “one file” requirement.

Regarding flexibility: there are no reasons you shouldn't be able to use flask with other template engines if that's what you're after. In fact, things like Flask-Genshi exist: Flask-Genshi and it's incredible easy to use mako with it, even without extension if you want to.

Bias warning: I am the developer of Flask, Werkzeug and Jinja2.

http://stackoverflow.com/questions/4941145/python-flask-vs-b...

In my own experience, both are great, and similar. For a simple REST API bottle has an added advantage of being a single file which is nice to just include with all of your other code rather than having to install anything. Flask, however, is my go-to framework. I used it extensively at a previous job and still do today with my current employer (and the app is pretty substantial). Flask also has a lot of extension support now. A pip freeze | grep Flask yields the following for one project.

  Flask==0.9
  Flask-Admin==1.0.5
  Flask-Assets==0.8
  Flask-Babel==0.8
  Flask-Cache==0.10.1
  Flask-Classy==0.5.2
  Flask-DebugToolbar==0.7.1
  Flask-Gravatar==0.3.0
  Flask-Login==0.1.3
  Flask-Principal==0.3.4
  Flask-SQLAlchemy==0.16
  Flask-WTF==0.8.2
1 comments

>The big difference is that Flask is based on other technologies such as Werkzeug and Jinja2 that exist for a longer time and it does not try to reinvent things. Bottle on the other hand tries to stick to the one-file approach. I want to merge them but the Bottle developer does not seem to be very happy about the idea of stepping away from the “one file” requirement.

And seeing that Flask still does not support Python 3, while Bottle does, I'm happy with the decision of the Bottle developer.

Not to mention that the "one file" makes deployment very easy.

Plus: Bottle is quite faster than Flask, even if you count the overhead of a DB query:

http://blog.curiasolutions.com/the-great-web-framework-shoot...

> Plus: Bottle is quite faster than Flask, even if you count the overhead of a DB query:

If you see bottle being faster than Flask in a real-world benchmark and the difference the problem there are still knobs to turn if you need to. Flask does not optimize at all for Benchmarks and you pay for some overhead out of the box for a better development experience.

A smaller surface for attacks, too. Might be a consideration.