top | item 5873052

New Werkzeug and Flask Releases

251 points| ch0wn | 12 years ago |lucumr.pocoo.org | reply

57 comments

order
[+] bjourne|12 years ago|reply
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 study Flask because it is such a great piece of software engineering.
[+] obviouslygreen|12 years ago|reply
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.

[+] reinhardt|12 years ago|reply
> There's no crazy stuff and few convoluted pieces

I dunno, I've recently started getting into it and "convoluted" is one word that has occurred to me more than once. Handlers vs signals, application and request context, context locals, local proxies, etc.. Probably there's a good reason for all these and the docs make a decent attempt to lay them out but overall my unscientific first impression is that it's not exactly a pinnacle of simplicity.

[+] coleifer|12 years ago|reply
Not only is the code great, but so is the documentation, the release notes, and the community.
[+] calpaterson|12 years ago|reply
For what it's worth, the internals of Bottle are very clean (and extremely simple - the entire library/framework is just one file).
[+] corford|12 years ago|reply
Congrats & well done guys :) Flask was the last major block preventing me from seriously moving over to Python3 so I guess that means it's time to begin porting! (there goes my weekend...)
[+] manuletroll|12 years ago|reply
Python 3 support! Now I can make the switch. Congratulations to Armin and all contributors, and a big thank you!
[+] cstuder|12 years ago|reply
So we're a PHP shop thinking about moving to Python. With this release, can we immediately start using version 3?

The Flask page still recommends holding back... (http://flask.pocoo.org/docs/python3/)

[+] corford|12 years ago|reply
Like irahul has said, the issue is the Flask extension ecosystem and documentation lag rather than Flask itself. Which basically means YMMV depending on what you need to get done :)

If you are writing most of your own code and not using Flask extensions then you could well be fine (unless, like the linked post says, you discover a few months down the line you _do_ need a couple of extensions and they haven't been ported yet!).

Also worth pointing out that lots of other great python libraries now fully support python3 so you can get a lot done with just Flask on its own and those e.g. requests, redis-py, psycopg2, pytz.

[+] irahul|12 years ago|reply
> With this release, can we immediately start using version 3?

You should stick with 2.7 As mentioned in your linked blog post, porting Flask to Python 3 wasn't the issue. The issue is the other libraries which you will use to build your web application which aren't on Python 3 yet. You can try to build a unified code base(runs on both 2.7 and 3) http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/

[+] kryten|12 years ago|reply
I picked up flask for a one off helpdesk request frontend for someone a few months ago.

Compared to asp.net, its an absolute joy to work with. It makes me not want to grind my face off with a blunt spoon :)

Glad to see some awesome progress with it.

[+] danibx|12 years ago|reply
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?

[+] alexk|12 years ago|reply
Yes, it's pretty reliable.

We (mailgun.com) use it in production, our deployment handles thousands of requests/sec, we have not seen any flask-related issues so far in 2+ years.

You can use pool of flask + twisted powered services behind nginxes:

Nginx ---upstream pool--> twisted.wsgi + thread pool + flask app

Something like that:

https://gist.github.com/klizhentas/5775158

[+] philfreo|12 years ago|reply
It's definitely production ready. We are using it everywhere in Close.io (http://close.io/)

If you're building a complex web app with it, just be sure to checkout all the Flask extensions so you don't have to reinvent the wheel too much.

[+] dkh|12 years ago|reply
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. It's a great mix of simplicity and power, and is great for learning. Go for it.
[+] liranz|12 years ago|reply
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.

[+] fyolnish|12 years ago|reply
I clicked this expecting a new release from Farbrausch : /
[+] dualogy|12 years ago|reply
Unlikely, right? Also their stuff uses double-k, so it's werkkzeug IIRC..
[+] drawkbox|12 years ago|reply
Flask is a very solid python microframework and a joy to work with. So nice it is on Python 3 (3.3+) now. boto is the only thing needed for full on Python 3 here.
[+] galaktor|12 years ago|reply
Here I was thinking this was about "werkkzeug" by Farbrausch
[+] voltagex_|12 years ago|reply
The popular demo!
[+] sigzero|12 years ago|reply
This is awesome. Been waiting to use it!
[+] taude|12 years ago|reply
Time to update some extensions!