Live data from Hacker News

Flask 1.0 Released

palletsprojects.com

41–50 of 184 posts

Re: Flask 1.0 Released

#41
post #14

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…

I agree. I particularly like Go's web ecosystem. A web server is just a function, and that function is often a composition of other functions (for example, a tree of router functions and then a handler for each route). By contrast, it seems like Flask goes to great lengths to obscure such a simple concept (decorators for routes, global variables for state and resource management, etc).

I wouldn't call it obscure, it's just an abstraction.

But you can always use the underlying library (http://werkzeug.pocoo.org/), which does send everything through a function. Or just implement WSGI directly.

Re: Flask 1.0 Released

#42

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.

Yet no Flask application I've ever written needed user auth :)

Re: Flask 1.0 Released

#43

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 is possible to register error handlers for exceptions in Flask. See http://flask.pocoo.org/docs/1.0/patterns/apierrors/ .

There are also exceptions corresponding to HTTP errors, e.g.:

  raise werkzeug.exceptions.NotFound
instead of abort(404)

http://werkzeug.pocoo.org/docs/0.14/exceptions/

Re: Flask 1.0 Released

#44
post #36
post #13

Earlier quoted context omitted.

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.

I disagree. With any sufficiently complex project, Django's batteries included got in the way whereas scaling Flask felt smooth.

Can you elaborate? In all the dozens of Django projects I've worked with, I've never felt like Django got in the way, mainly because everything is pluggable and you can just not use it if you don't want to.

Re: Flask 1.0 Released

#45
post #16

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…

Pyramid is great, lacks the problems (magic) you mentioned, and is now what pypi.org is built on: https://docs.pylonsproject.org/projects/pyramid/en/latest/in... I’ve used it off and on since 2010 (as Pylons) and have been happy with it.

Wow, I didn't make the connection until now that pypi.org is built on Pyramid. That's cool. :-)

Some more links for anyone interested:

https://github.com/pypa/warehouse

https://trypyramid.com/community-powered-by-pyramid.html

Re: Flask 1.0 Released

#46
post #28

Flask has a stigma for not being that good when building larger apps, but honestly Flask scales really well for that type of use case (coming from a development / maintenance point of view). I have some pretty large Flask apps with dozens of top level dependencies and models spanning across many thousands of lines of code. Even if I don't touch the code base for a few months, it's easy to jump back into it. I'm also…

This reference to buildasaasappwithflask.com deserves a disclaimer (I assume you're the author - the initials match)

Re: Flask 1.0 Released

#47
post #46
post #28

Flask has a stigma for not being that good when building larger apps, but honestly Flask scales really well for that type of use case (coming from a development / maintenance point of view). I have some pretty large Flask apps with dozens of top level dependencies and models spanning across many thousands of lines of code. Even if I don't touch the code base for a few months, it's easy to jump back into it. I'm also…

This reference to buildasaasappwithflask.com deserves a disclaimer (I assume you're the author - the initials match)

The sentences immediately following the URL makes it pretty clear the commenter's relationship with the site:

> "It's a full blown course where we build a SAAS application using Flask and Docker. I recently added a free RESTful API bonus section to the course and now that Flask 1.0 out, I'll be adding another free update which will cover updating all of the packages in the main app."

Re: Flask 1.0 Released

#48
post #31
post #28

Flask has a stigma for not being that good when building larger apps, but honestly Flask scales really well for that type of use case (coming from a development / maintenance point of view). I have some pretty large Flask apps with dozens of top level dependencies and models spanning across many thousands of lines of code. Even if I don't touch the code base for a few months, it's easy to jump back into it. I'm also…

> 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 your system. Good luck trying to tune your database when any template can trigger hundreds of db calls!

Re: Flask 1.0 Released

#49
post #47
post #46

Earlier quoted context omitted.

This reference to buildasaasappwithflask.com deserves a disclaimer (I assume you're the author - the initials match)

The sentences immediately following the URL makes it pretty clear the commenter's relationship with the site: > "It's a full blown course where we build a SAAS application using Flask and Docker. I recently added a free RESTful API bonus section to the course and now that Flask 1.0 out, I'll be adding another free update which will cover updating all of the packages in the main app."

I'm sorry, it's been a long day and I apparently can't read anymore.
Post reply on HN