News for hackers. Stuff that matters.
Re:Flask 0.11 Released by zxcvcxz on Sunday May 29, 2016 @08:11AM (#11796072)
Are there any high traffic web pages using Flask? I'm interested but when I look at job listings it's really rare I see anything for flask compared to React/Angular/RoR.

If I was a python dev it seems like it might be worth learning but since I'm a web dev and already know a few frameworks I'm struggling to find a reason to teach my self flask.

Does Flask have any advantage over something like Angular?

Re:Flask 0.11 Released by Chris_Newton on Sunday May 29, 2016 @10:02AM (#11796387)
Flask is a server-side framework, so it’s not directly comparable to front-end frameworks like React or Angular. It plays a similar role to Rails in Ruby, Django in Python or Symfony in PHP, though it’s further towards the lightweight/flexible end of the spectrum than any of those.

I don’t know what you’d consider high traffic, but we have used and continue to use Flask in production for a variety of systems. Those include:

- providing the back ends for relatively large and complicated single-page applications;

- implementing more traditional web sites, with very little JS on the front end, which use Flask to do almost all of the routing and rendering; and

- implementing dedicated HTTP-based APIs for integration with third party services.

Flask is an excellent tool, and that is not a description I use for very much in the software world. It provides widely useful functionality, it has a tidy design and a reliable implementation, it’s well documented, and it imposes few overheads or unnecessary dependencies. If you’re purely a front-end dev then that functionality isn’t what you need and neither is Flask. If you’re interested in the back end as well, you could do a lot worse than to learn Flask.

Re:Flask 0.11 Released by ntietz on Sunday May 29, 2016 @08:25AM (#11796113)
Flask would be more comparable to RoR than to Angular, since it is principally for backend work. (You can do server-side-rendered front-end stuff with it, with templates, but I choose not to -- currently working with Flask for my backend API, React for frontend).

There are two main features of Flask for me, over something like RoR: it's Python (my preference over Ruby); and it's a very light framework with a ton of modules, compared to my perception that RoR is pretty big and heavy and opinionated.

YMV, I only do this stuff in my evenings so I'm not terribly familiar with it all.

Re:Flask 0.11 Released by Macha on Sunday May 29, 2016 @08:32AM (#11796139)
Sinatra has always seemed more like the ruby equivalent of Flask, but I only have a small (and by now, dated) experience of ruby web dev
Re:Flask 0.11 Released by StavrosK on Sunday May 29, 2016 @08:39AM (#11796157)
My Ruby developer friend agrees with you, so I think you're accurate.
Re:Flask 0.11 Released by rcarmo on Sunday May 29, 2016 @08:24AM (#11796108)
You're comparing apples to oranges here. Flask is a server-side framework and doesn't care one whit about what you put on top - it just serves up requests.
Re:Flask 0.11 Released by truebosko on Sunday May 29, 2016 @08:59AM (#11796202)
We deploy a heavily used REST API that at the top level, is using Flask to capture/proxy/marshal the request and response. We decided to use it over Django simply because we did not need a large set of the Django features.
Re:Flask 0.11 Released by wpietri on Sunday May 29, 2016 @03:17PM (#11797790)
> I'm interested but when I look at job listings it's really rare I see anything for flask compared to [...] RoR.

That's because Flask is simple. You advertise RoR when you want somebody who doesn't need to spend a lot of time learning Rails. But nobody needs to spend a lot of time learning Flask.

That's also a drawback of Flask, in that you have to build or add more to get the same higher-level expressiveness of something like Rails. But if what the project needs is a relatively low-level web framework, it's a fine, easy-to-learn choice.

Re:Flask 0.11 Released by Twirrim on Sunday May 29, 2016 @03:04PM (#11797725)
Reddit uses Flask for parts of the site.

Uber uses Flask & Nginx for part of their site.

The 2012 Obama campaign team (who really shook up the use of internet & tech in campaigning) used Flask too.

Mailgun uses Flask for their API (reported). Stack is verified here, but no details given: http://stackshare.io/mailgun/mailgun

Re:Flask 0.11 Released by softinio on Sunday May 29, 2016 @10:10AM (#11796423)
Flask = backend

Angular = Front end

Bizarre you are comparing them. Suggests you have not used either.

I have no idea where you are looking for jobs but where I am demand for Flask and Django are booming and there is a shortage of them.

Re:Flask 0.11 Released by brbsix on Sunday May 29, 2016 @08:38AM (#11796155)
Not sure what kind of traffic they get, but httpbin.org uses it. Also this one site named Pinterest.
Re:Flask 0.11 Released by keshab on Sunday May 29, 2016 @09:36AM (#11796307)
I am sorry, but it seems that Pinterest is written using Django.

https://www.djangoproject.com/start/overview/

Re:Flask 0.11 Released by tomnipotent on Sunday May 29, 2016 @10:04AM (#11796399)
Re:Flask 0.11 Released by dempseye on Sunday May 29, 2016 @10:32AM (#11796479)
That page does not support the statement that they moved off Django to Flask.
Re:Flask 0.11 Released by tomnipotent on Sunday May 29, 2016 @01:44PM (#11797332)
It further links to this post:

https://www.quora.com/What-is-the-technology-stack-behind-Pi...

> They started with Django but moved out of Django and currently use 'home grown framework on top of Flask'.

Re:Flask 0.11 Released by lrem on Sunday May 29, 2016 @11:14AM (#11796615)
But it supports that they do use Flask.

> Presently, the API does over 12 billion requests per day, all in Flask.

Wow, that is 138kqps. Not something that would strike me as your typical Python workload.

Re:Flask 0.11 Released by ubernostrum on Sunday May 29, 2016 @05:56PM (#11798416)
There are lots of those lying around.

I don't know if it still is, but when I was at Mozilla the service that every instance of Firefox around the world hits to do the version/extension-compatibility checks was backed by Django, and was at something like 15k req/s served. Firefox has gained some market share in the four-ish years since I got that number, so probably larger now.

Re:Flask 0.11 Released by nly on Sunday May 29, 2016 @11:55AM (#11796774)
Whacking great big CDNs in front of your infra will do that.
Re:Flask 0.11 Released by lrem on Sunday May 29, 2016 @12:08PM (#11796835)
What exactly a CDN can do to increase the qps throughput of your backend? I thought it's used to reduce it...
Re:Flask 0.11 Released by zeemonkee3 on Sunday May 29, 2016 @12:09PM (#11796844)
IIRC Twilio use Flask, and contributed the flask-restful library [1]

[1] https://github.com/flask-restful/flask-restful

Re:Flask 0.11 Released by yisheng on Sunday May 29, 2016 @11:51AM (#11796759)
Flask is a server-side framework, as others have mentioned.

You should be comparing it to micro web frameworks like Nodejs' Express, Ruby's Sinatra, PHP's Slim, Java's Spark, etc.