4 ms·
Curious how Flask compares to Bottle, in terms of features, "developer velocity", performance?
by bsg75 14y ago
Curious how Flask compares to Bottle, in terms of features, "developer velocity", performance?
- falcolas 14y agoMore features (such as the included Jinja2 templating system), similar developer velocity (built on the same principals and concepts), probably similar performance, since both rely on external http(s) servers to handle the heavy lifting. The main advantage bottle holds over flask is that it's a single file that you can import, instead of a package. Makes it very portable.
- bsg75 14y agoAs someone who is not a web developer, but has a need to create a few internal apps, portable sounds like simple - exactly what I need. My desire: (1) grab data, (2) render chart / graph, (3) display in browser Without needs like session management, concurrency, etc., Bottle "sounds" easier, which is mostly based on the 1 file import thing, and why I was looking at Bottle last time I did not get this project rolling.
- viscanti 14y agoYou can do the "1 file thing" with either. It's enforced in Bottle but not in Flask. I've used both and would recommend going with a Flask(web-framework)/SQLAlchemy(database or part that "grabs data") combo that sends JSON to a javascript chart/graph library. You should be able to find a number of Flask/Backbone demos on github. Checking out a few of those would be a good place to start, even though you'll probably be scrapping backbone and just using a javascript charting library instead.
- irahul 14y ago> You can do the "1 file thing" with either. The GP was referring to bottle.py being one file and one import, not about the ability to have the whole app in one file.
- rch 14y agoI use Flask routinely for exactly what you've described. The 'blueprint' approach to modularity keeps things dead simple.
- falcolas 14y agoBased on your description here, you would do well to use either one. Just based of my experience, I'd go with Bottle, and when/if you hit the limit of its functionality, you can pretty much seamlessly convert between the two. Flask is great, and offers you so much more flexibility, but there's just something about the simplicity of Bottle that draws me back to it whenever I need to make a simple web app.
- bsg75 14y agoI had looked at Bottle for a similar reason some time ago. Looking into using Bottle and Highcharts for a first experiment. Maybe Google Charts as well.
- antihero 14y agoHow is that any easier than just using a virtualenv for anything but the most simple of scripts with zero other dependencies?
- falcolas 14y agoGiven that the parent was asking for nearly exactly that (a simple script with few/if any other dependencies), a virtualenv would not be easier. A virtualenv would certainly be proof against future environment changes, perhaps, but it would probably be more effort than necessary for simple forms.
- antihero 14y agovirtualenv . --no-site-packages; source bin/activate; pip install flask Three commands. Even less if you use virtualenvwrapper. Plus, you are insane if you don't use virtualenvs for development anyway.