Live data from Hacker News

New Werkzeug and Flask Releases

lucumr.pocoo.org

51–59 of 59 posts

Re: New Werkzeug and Flask Releases

#51
post #48

Earlier quoted context omitted.

Still no evidence in your comment. Repeating his "I had to make X big to support all of wsgi/http so anyone who made a similar framework but much smaller has made it incomplete or too succint and clever in a bad way" is not evidence. You say: > bottle's smaller size means either the implementation is incomplete or the implementation is too clever or both. That's a statement of fact (actually a dichotomy of facts). Wh…

It would have taken less effort just to try out both frameworks, and then you wouldn't need anyone else's "evidence".

>It would have taken less effort just to try out both frameworks, and then you wouldn't need anyone else's "evidence"

I've tried both frameworks, and looked at the code for both, and I'm of the opposite opinion.

Yours is not a very suggestion. It presupposes what is asked to provide evidence for. That's called a circular argument.

Re: New Werkzeug and Flask Releases

#52
post #38
post #26

Earlier quoted context omitted.

Regardless of Flask's humble beginnings, it is indeed a serious project, very stable, and quite awesome. And yes, I would recommend it for your use, assuming you want to learn Python as a whole. Flask is easy enough that you can start building an app right away, but at the same time, it leaves out all the extra 'magic' that ship with things like Django, so you'll be learning a lot more Python as you add onto your app…

I'm curious about what you think is "magic" in Django? It does have a lot more included than Flask/Werkzeug/Jinja2 but it did start in the era before Pip/VirtualEnv existed so a lot more had to be included. After numerous purges (the magic-removal-branch being the biggest) and deprecations over the years since 1.0, Django is IMO pretty magic-free. If you have suggestions of what isn't Pythonic enough, I think the cor…

I think it's the different between a normal python application and a web app: url dispatcher/route, request handler, template, extension...I started with Django, but Flask clears thing better for me.

Re: New Werkzeug and Flask Releases

#53
post #6

Flask is about the most beautiful Python code you can write. Check out any other Python framework and they may have a decent api, but on the inside it is messy and confusing. Reading Flask source code on the other hand is a joy. There's no crazy stuff and few convoluted pieces + lots of comments so it is really easy to hack something if you must. Any Python coder who wants to improve their game definitely should stud…

For what it's worth, the internals of Bottle are very clean (and extremely simple - the entire library/framework is just one file).

I've also found Tornado to be quite readable. But my norm is corporate closed source code which is pretty unreadable.

Re: New Werkzeug and Flask Releases

#54
post #53

Earlier quoted context omitted.

For what it's worth, the internals of Bottle are very clean (and extremely simple - the entire library/framework is just one file).

I've also found Tornado to be quite readable. But my norm is corporate closed source code which is pretty unreadable.

I agree here, I think Tornado is really quite readable. I was pleasantly surprised the first time that I looked at the source.

Re: New Werkzeug and Flask Releases

#56
post #6

Flask is about the most beautiful Python code you can write. Check out any other Python framework and they may have a decent api, but on the inside it is messy and confusing. Reading Flask source code on the other hand is a joy. There's no crazy stuff and few convoluted pieces + lots of comments so it is really easy to hack something if you must. Any Python coder who wants to improve their game definitely should stud…

Check out any other Python framework and they may have a decent api, but on the inside it is messy and confusing. This is a really disingenuous generalization. If it's not Flask, it's messy and confusing? Telling every framework developer who's not the author of this one library that their code is crap not only isn't a great way to be taken seriously, it's wrong and just kind of mean.

The natural state of any large codebase maintained by multiple persons over multiple years is to be messy and confusing. Therefore it isn't a slight to anyone to state that the Flask devs have been able to keep their source code much cleaner than the average.

Re: New Werkzeug and Flask Releases

#57

Earlier quoted context omitted.

> application and request context, context locals, local proxies Those are just different names for the same thing. Maybe the docs are a bit too in-your-face with the contexts but I rather expose people to it early to avoid issues down the line. Django for instance does not have equivalents for application and request contexts and the end result is that people often write thread unsafe code and you can only have one…

There is a difference. Having a request or application context that encapsulates state is one thing, an architectural decision that simplifies multi-tenancy and makes many uses of Flask more performant. These are "simple", in that they are an obvious and easily-explained solution to a technical problem that exists by necessity. Global proxies to local state are another beast entirely. They are "easy" in that they rem…

I learned that you need context locals in web applications or beginners will write themselves into a corner where they have an architectural problem on their hand they can't fix later on.

Yes, it's not the best solution, but passing things around isn't either.

Re: New Werkzeug and Flask Releases

#58
post #51

Earlier quoted context omitted.

It would have taken less effort just to try out both frameworks, and then you wouldn't need anyone else's "evidence".

> It would have taken less effort just to try out both frameworks, and then you wouldn't need anyone else's "evidence" I've tried both frameworks, and looked at the code for both, and I'm of the opposite opinion. Yours is not a very suggestion. It presupposes what is asked to provide evidence for. That's called a circular argument.

[deleted]

Re: New Werkzeug and Flask Releases

#59
post #24

I read somewhere that Flask was born as an Aprils first joke. So I ask. How safe is it to use in a real project? Is it a serious project today? Would you recommend Flask to someone who has never done any server side programming?

We use flask at fusic.com and find it very reliable and easy to work with. Our peaks have over 1m rpm, and it has never fails us. We did a huge project migrating from Django, and now we don't have to jump through hoops so much.

I think flask has a front page that discourages newcomers, as it does not look as serious as Django, and gives the feeling that is it not mature enough, or documented. I tried convincing a new startup to use it and failed for those reasons.

Post reply on HN