Live data from Hacker News

Flask 1.0 Released

palletsprojects.com

71–80 of 184 posts

Re: Flask 1.0 Released

#71

Love Flask in theory. My biggest complaint was trying to do user management with it. Flask-Security was good, but the developer skipped town a few years ago. Did they come back? :D Basically you are left to your own devices, which sounds great, but user+auth is pretty fundamental to be left to a random absentee third-party in my opinion.

Try farming out the auth to a middleware. That's what I do and it works really well.

Like openam? or what do you suggest.

Re: Flask 1.0 Released

#72

wow, lot of Flask haters here. I personally love it and have used it for a ton of smaller projects. For example, I just deployed this a couple days ago: http://dadjoke.info

FYI your home page refers to "DadJokeJunkie.com promises not to spam you or share your number and you can opt out at any time." but that is not your site :P

Re: Flask 1.0 Released

#73
post #13

I understand that Flask has become popular because it is easy to learn, but my experience is that as your knowledge progresses it just keeps getting in your way. I particularly dislike some design choices which look like afterthought hacks, such as global variables for current request and using abort() functions instead of raising exceptions directly. EDIT: To avoid hollow naysaying, here are some alternatives to Fla…

The real value of Flask is that it makes you appreciate what Django does by default. When I first started learning Python / web frameworks, I went with Flask because it was smaller and "simpler". As my project grew however, I had to organize it. I was basically imitating what Django gives you by default, though less cleanly.

Especially when you then go to maintain a Flask project where they have re-implemented Django, except you don't know where anything is or how it works.

Re: Flask 1.0 Released

#74

I understand that Flask has become popular because it is easy to learn, but my experience is that as your knowledge progresses it just keeps getting in your way. I particularly dislike some design choices which look like afterthought hacks, such as global variables for current request and using abort() functions instead of raising exceptions directly. EDIT: To avoid hollow naysaying, here are some alternatives to Fla…

It's my go-to prototype framework/server, but I think it's going to complicate things unnecessarily down the road if you want to scale. You can make it work for prod if need be, though.

But you can go from 0-59 with ease and easily translatable templates, etc.

Re: Flask 1.0 Released

#75
post #48
post #31

Earlier quoted context omitted.

> Flask has a stigma for not being that good when building larger apps Not sure how to quantify that "large" but I've worked on some api backend services written in Flask with a quarter million lines of python code and not feeling "outgrowing" Flask. Granted, it took some good design and effort to make all piece s work together. These days, horizontally scale apps is the way to go.

In my experience, Django is less suitable for large projects than Flask. The nature of Django encourages tight coupling between unrelated parts of the system - Models intertwine database operations and business logic, ModelViews intertwine db operations, business logic and the interface layer. This is manageable in the small, but when you hit scale, this tight coupling adds a whole bunch of unnecessary complexity to…

I was about to post something similar, but this nicely summarizes my feelings. Even with DRF (for REST APIs) the extreme coupling at all layers makes things painful, though it's possible to reduce that pain a little with some carefully enforced rules.

(I would like to see a way of disabling QuerySet traversing, so that if you try to access something that you didn't already prefetch_related/select_related then you just hit an error (and therefore fix it before you go live). The behaviour of just happily issuing hundreds of DB queries in a single request really hides a bunch of architectural and performance issues.)

That said, as the sibling comment says, if you need a simple- to moderate-complexity, mostly CRUD API, and particularly if you need it fast, then Django is a great tool.

Re: Flask 1.0 Released

#76
post #23

I understand that Flask has become popular because it is easy to learn, but my experience is that as your knowledge progresses it just keeps getting in your way. I particularly dislike some design choices which look like afterthought hacks, such as global variables for current request and using abort() functions instead of raising exceptions directly. EDIT: To avoid hollow naysaying, here are some alternatives to Fla…

Falcon is just as simple to learn as Flask but so much more pythonic. It also blazing fast. With that said good to see Flask get to 1.0. Long time coming.

What about the ecosystem around it?

Re: Flask 1.0 Released

#78
post #22
post #11

Earlier quoted context omitted.

Hopefully! There's a bad attitude I've noticed about Flask, people don't take it seriously and treat it like a learning tool or a library for quick and dirty hack projects. All because it's simple to learn and free of bullshit and Just Works™. Should lead to the opposite attitude, but nope. People apparently enjoy extra complexity.

I think a lot of criticism is valid. Flask has a lot of bizarre conventions which don't scale well, like stuffing all shared resources into the global context or app-level dicts and using `@route()` decorators all over, for example. And I'm not sure what the benefit is, except that clever feeling one gets when they use decorators or other seemingly magical features unnecessarily and later need to workaround the tight…

Decorators improve dev speed. No need to be constantly switching back and forth between views and urls.py.

Still, sometimes nice to see all in one place.

Re: Flask 1.0 Released

#79

Earlier quoted context omitted.

Try farming out the auth to a middleware. That's what I do and it works really well.

Does it interface with sqlalchemy, onboarding, email, etc?

Your auth middleware can attach a user object to environ that your downstream apps could reference.

Whatever else you do (email, onboarding, sqlalchemy) you can do downstream, or directly in the (or a different ) middleware if you want.

Re: Flask 1.0 Released

#80
post #4

Love Flask. It is my favorite back-end framework and has fit all of my needs. Getting a server up and running with Flask is incredibly simple and if anybody hasn't played with it yet, I highly recommend it.

It's all fun in games until the project you just started yesterday already needs an, albeit simple, upgrade.
Post reply on HN