Live data from Hacker News

Comparing Python frameworks: A simple webapp in Flask, web.py, bottle, juno ...

agiliq.com

21–30 of 33 posts

Re: Comparing Python frameworks: A simple webapp in Flask, web.py, bottle, juno ...

#21
post #4

FWIW, I've been using Flask. It seems to be the one having the most traction and support these days. But I think frameworks are not that important. I use Flask mostly for its HTTP request handling functionality. But everything else is my own (e.g., the overall setup, configuration etc). I think what's most important is understanding that loosely coupled components are the way to go. Know how your scripting language l…

(Flask for its HTTP request handling functionality)++

This is the _main_ reason I chose Flask to work on a new project. After using our in-house proprietary framework for a year and a half, I wanted to see if I could do any better. But the HTTP request part sounded boring. Enter Flask: it let's me grow the framework into exactly what I want it to be.

Re: Comparing Python frameworks: A simple webapp in Flask, web.py, bottle, juno ...

#22

Not to diminish the contribution from shabda - but what would really interest me is hearing about these frameworks from the perspective of someone who has launched and maintained a complex system, not a toy app.

I've built my startup entirely in Python + Pylons (1.0). Pylons is wonderful, I really like it a lot and I'm excited about its future too (move to Pyramid which is basically repoze.bfg).

The application I'm running is large, complex, and has quite a few moving parts.

I run it under mod_wsgi in Apache and use the Paster server when developing on my local machine. I particularly love the unit testing harness for Nose that Pylons provides.

Re: Comparing Python frameworks: A simple webapp in Flask, web.py, bottle, juno ...

#23
post #4

FWIW, I've been using Flask. It seems to be the one having the most traction and support these days. But I think frameworks are not that important. I use Flask mostly for its HTTP request handling functionality. But everything else is my own (e.g., the overall setup, configuration etc). I think what's most important is understanding that loosely coupled components are the way to go. Know how your scripting language l…

You should maximize the use of ready-to-use extensions once you know how things work, whether yours or the community's.

Re: Comparing Python frameworks: A simple webapp in Flask, web.py, bottle, juno ...

#24
post #4

FWIW, I've been using Flask. It seems to be the one having the most traction and support these days. But I think frameworks are not that important. I use Flask mostly for its HTTP request handling functionality. But everything else is my own (e.g., the overall setup, configuration etc). I think what's most important is understanding that loosely coupled components are the way to go. Know how your scripting language l…

+1 for Flask. It very much gets out of your way. Interestingly it still feels like you have it both ways (batteries included but loosely coupled) as the series of extensions are high quality thin wrappers for good libraries - namely Babel, Fungiform and SQLAlchemy. For me this was a great introduction to these aforementioned libs.

Re: Comparing Python frameworks: A simple webapp in Flask, web.py, bottle, juno ...

#25
post #8

I realize that scalability probably wasn't a concern when you made these demos.. but it doesn't look like any of these can handle many concurrent requests (incoming, or outgoing to facebook). Are any of these frameworks even compatible with the event driven mechanisms like twisted, tornado, etc? I'm having to pick up Python since a lot of the webapp infrastructure at the startup I joined is Python/Django and I haven'…

Thanks to WSGI you can. For example, here's a handy page in Flask's (outstanding I might note) documentation on how you can run it on Tornado, Gevent and Gunicorn:

http://flask.pocoo.org/docs/deploying/others/

Re: Comparing Python frameworks: A simple webapp in Flask, web.py, bottle, juno ...

#26
post #4

FWIW, I've been using Flask. It seems to be the one having the most traction and support these days. But I think frameworks are not that important. I use Flask mostly for its HTTP request handling functionality. But everything else is my own (e.g., the overall setup, configuration etc). I think what's most important is understanding that loosely coupled components are the way to go. Know how your scripting language l…

loosely coupled components are the way to go

I disagree. Had you added "in some situations" I wouldn't.

The point of the frameworks, which are heavily coupled components with many constraints, conventions and hidden parts of functionality is rapid prototyping. That means that you can go from 0 to something quickly without knowing all the details. For a large class of use-cases the ability to get something out there fast is more important than the technical debt you may incur by not knowing how everything is loaded. This is the case for a lot of new products, startups and such.

On the flipside, if you have a very solid spec of what you're building (for example, if you are re-writing an already-existing piece of software with a browser-level test suite as spec so that it is easier to scale) then loosely coupled components are likely the way to go. And yes, as soon as scale comes into question loosely coupled components that you understand well are the way to do it. This just isn't always the case.

Secondly, it is not clear whether the frameworks get in your way that much. I remember reading a blogpost about a shop replacing django bit by bit until there was no django. That seems pretty cool. On the other hand, there is disqus, which used django from the get-go, I think, and haven't swapped it out, but just built a lot of tools around it. On the third hand, there is probably a lot of sites that start with loosely coupled components and keep refining. They are all valid approaches. At the time you are starting it is usually unclear how to go about it.

In general I agree that people should try to understand how their tools work, but there are only so many hours in a day, y'know?

Re: Comparing Python frameworks: A simple webapp in Flask, web.py, bottle, juno ...

#27
post #10

Not to diminish the contribution from shabda - but what would really interest me is hearing about these frameworks from the perspective of someone who has launched and maintained a complex system, not a toy app.

Probably over the next weekends, Ill do a basic blog in these frameworks. Not complex, but should give me a chance to test the ORM, Session, Cookies etc.

That would be really interesting to see the details required for each framework in comparison to each other.

Re: Comparing Python frameworks: A simple webapp in Flask, web.py, bottle, juno ...

#28

web2py deserves a place on the list. I've found it to be more productive than django.

It's in the github repo.

that example needs to be cleaned up - it includes databases, error tickets, sessions, etc, which makes it look more complicated than the others.

Re: Comparing Python frameworks: A simple webapp in Flask, web.py, bottle, juno ...

#29
post #26
post #4

FWIW, I've been using Flask. It seems to be the one having the most traction and support these days. But I think frameworks are not that important. I use Flask mostly for its HTTP request handling functionality. But everything else is my own (e.g., the overall setup, configuration etc). I think what's most important is understanding that loosely coupled components are the way to go. Know how your scripting language l…

loosely coupled components are the way to go I disagree. Had you added "in some situations" I wouldn't. The point of the frameworks, which are heavily coupled components with many constraints, conventions and hidden parts of functionality is rapid prototyping . That means that you can go from 0 to something quickly without knowing all the details. For a large class of use-cases the ability to get something out there…

You have a point. Let me elaborate my thoughts on Flask a bit further.

Personally, my experience is that for rapid prototyping, there's nothing better than starting with the absolute minimum possible, and with a full-blown monolithic framework, the absolute minimum is, more often than not, too much.

I prefer starting a project with a couple of files, like fabfile.py and app.py, than starting a project with a bunch of directories and tons of blueprinted configuration files. It's hard to explain why, I just feel it's a lot easier for me to evolve an idea, from a small prototype to a finished product, with this approach. I guess the cognitive signal to noise ratio is just higher that way. I know many people share this feeling, otherwise Sinatra and all these Python microframeworks wouldn't be getting so much attention.

I think a good framework is like a good government, consistent, helpful, but with self-limiting interference. I think documentation is way more important than features. I'll take a well written web development patterns guide over a framework that does it all for me under the hood any day. The thing is that Flask tries to be both. Flask's documentation is absolutely fantastic. It is no surprise, of course, since it comes from the same guys who made the Sphinx documentation builder.

I like conventions. I just don't think they ought to be mandatory. I see Flask as a genome of web applications, with pre-defined solutions and information on how to accomplish a series of things, but my application itself doesn't have to be a grown organism from the beginning, it can start small, like an embryo, and slowly grow in size. Flask gives you enough flexibility to employ conventions but also do things differently, to invent your own way, when you feel that you need to.

Re: Comparing Python frameworks: A simple webapp in Flask, web.py, bottle, juno ...

#30
post #17
post #4

FWIW, I've been using Flask. It seems to be the one having the most traction and support these days. But I think frameworks are not that important. I use Flask mostly for its HTTP request handling functionality. But everything else is my own (e.g., the overall setup, configuration etc). I think what's most important is understanding that loosely coupled components are the way to go. Know how your scripting language l…

Flask looks delicious. On the other hand, for this specific app -- bottle, itty and juno all look very similar to the app made with flask. For whatever reason I find this very Pythonic.

web.py is similar in philosophy and verbosity, and probably older as well
Post reply on HN