14 ms·
There are no open issues or pull requests on Flask
- elbigbad 4y agoI love flask so much. Along with requests it has been among the two single most useful things about Python for me and the things I typically reach for Python for.
- maxbond 4y agoFully seconded, I just want to add for those of you in the asyncio world, aiohttp and FastAPI provide nearly identical APIs to requests and Flask (respectively), and for those of you familiar with these tools, they're a great way to be productive with asyncio almost immediately.
- clintonc 4y agoWhat's the advantage over using Flask's built-in support for async described here? https://flask.palletsprojects.com/en/2.1.x/async-await/ https://flask.palletsprojects.com/en/2.1.x/async-await/ This is an honest question; I don't know much about python async yet.
- heavyset_go 4y agoFlask still uses WSGI while other options use ASGI or other async interfaces.
- etimberg 4y agoAnother advantage of FastAPI is the pydantic integration for data validation. That being said, I think FastAPI needs to find a community governance model because there are a lot of long-standing issues that the community has tried to fix only to find those fixes languishing with no official response.
- whitey0101 4y agoFastapi and sqlmodel both suffer from this (same author).
- heavyset_go 4y agoWhat are some of the long-standing issues with FastAPI?
- maxbond 4y agoI wasn't aware of this support! That would certainly be a more natural choice if you were already familiar with Flask. To me the biggest advantage of FastAPI is the excellent integration with type hinting. It permeates the entire framework and makes things really productive. When I saw how you could use Pydantic models to define the schema of your request and response body, and then have that autogenerated into documentation - there was no going back. https://fastapi.tiangolo.com/tutorial/body/ https://fastapi.tiangolo.com/tutorial/body/ But I would like to stress that, though it has displaced Flask in my workflow, I think of FastAPI as a spiritual successor to Flask, and would never say an ill word about Flask.
- maxbond 4y agoI looked at Flask's docs again for the first time in a few years. And I do miss having such industrial grade documentation for my framework. I miss it real bad.
- aastronaut 4y agoexcept for the autogenerated docs, you can also make use of Pydantic in Flask easily to validate your models with Flask-Pydantic[0] [0]: https://github.com/bauerji/flask-pydantic https://github.com/bauerji/flask-pydantic
- ramraj07 4y agoI’d still choose FastAPI for its dependency framework which is so much better than the god awful ‘g’.
- aenis 4y agoFlask async still uses individual workers for their "async views". So, suppose your db has a bad moment and freezes for 20 seconds. All your flask worker threads become frozen on this IO - say, you have 50 of them. Your backend will time out on the 50 requests and won't even accept the 51st. Depending on how you are hosted, you may begin to autoscale aggresively because your (limited) worker threads on every node are locked. If you get lots of request you will soon find yourself running with hundreds of nodes, all of them waiting for the DB to get unstuck - and costing you money. With a proper async framework, you will keep accepting all the requests as they come -- a single node can take thousands of those requests and time out on them gracefully, as they are just lightweight entries in the event loop, and you can have lots of those compared to # of worker threads. Of course, fully async framework requires all your code to be fully async, which in practice means minimizing the # of dependencies since its hard to trust them. And problems with SDKs, like for instance on GCP where Google keeps lacking async support (!) for most of their things. So with the "hybrid" async you get from Flask you can still choose to use sync code for some things and async for others.
- dbcurtis 4y agoInteresting. I have used Quart in the past for “Flask with asyncio support” and it was a great experience. Everything even played well with an asyncio MODBUS library that was part of the same project.
- GOATS- 4y agoTry httpx if you want an async web client has a more identical API to requests. https://www.python-httpx.org/ https://www.python-httpx.org/
- mmcnl 4y agoI learned about this thanks to you. Looks great.
- b_mc2 4y agoAgreed with both of these. Flask and HTMX has been an awesome combination.
- adfm 4y agoFlask + HTMX is the new hot sauce.
- lgas 4y agoReally anything + htmx. That's part of the beauty of it.
- iasay 4y agoThis is the first time I hear of HTMX. Thanks for the heads up on it.
- b_mc2 4y agoHTMX has been great because I've just added a single endpoint in Flask that HTMX pings and makes it feel and respond like a single page application. You can have a flask endpoint, use Jinja to create the HTML and plug it into your page with HTMX. really nice and simple.
- adastra22 4y agoAdd SQLAlchemy to that list!
- shaftoe444 4y agoIt's just the right level of being able to get a lot of stuff done but without too much "magic".
- Cyph0n 4y agoAgreed. Personally, I find that too much magic impedes my learning process. So when I was first learning Python, I was able to understand how Flask works fairly quickly. The documentation is also excellent imo.
- jacinda 4y agoI love the Python web framework community and how friendly it is. The first two replies are congratulations from major Django contributors (Jeff Triplett and Andrew Godwin).
- b_mc2 4y agoFlask Github: https://github.com/pallets/flask https://github.com/pallets/flask
- ece 4y agoIssue Zero, it's possible. TIL.
- adenozine 4y agoWhat a feat! Great work, I use Flask somewhat often. I am not surprised they’ve managed to do this, considering how rock-solid the module seems.
- followben 4y agoIf only FastAPI could achieve the same…
- mr90210 4y agoNode/JavaScript frameworks: are we a joke to you? Lol
- capableweb 4y agoFastAPI has 50% as many issues open right now, as Flask has had in total (1.1K vs 2.3K), and ~500 open PRs currently while Flask has had ~2.2K PRs in total. Yet, both repositories have closed the same amount of issues during the last month, but FastAPI only merged 2 PRs while Flask has merged 21. Popularity probably plays into this a lot, but it's also just very clear that whoever is doing the management of Flask, is doing an excellent job! Kudos.
- FrenchyJiby 4y agoI personally have a PR ready to go which adds documentation for API Key Auth (missing page till now, very requested by community[1]), which has been ready since early May, stagnant for almost 3 months now[2], don't know how to bump without spamming. It's unfortunate, because FastAPI is one of the best libraries I know of otherwise in terms of capabilities for time spent writing code. Nowadays, though, when recommending this lib at work, I need to add "but pray you don't hit a bug or missing docs, or you're on your own". [1]: https://github.com/tiangolo/fastapi/issues/142 https://github.com/tiangolo/fastapi/issues/142 [2]: https://github.com/tiangolo/fastapi/pull/4818 https://github.com/tiangolo/fastapi/pull/4818
- kortex 4y agoFastAPI has a lot of straight-up low-effort, borderline spammy questions. I think it's a community /communication thing. Somehow flask keeps the riff-raff down, or at least in the discussion and out of issues. So however they do that, FastApi needs to do as well. On top of that it definitely is in need of more top-down organization, delegation, and coordination.
- 4y ago
- anyfactor 4y agoI love flask. I use restful flask on every project and I experimented with flask restplus and flask restx. I don't feel technically limited with Flask or it's derivative API frameworks. Flask will always be my go to framework but I am looking forward to actually sitting down learning Fast API and Nestjs with Typescript. FastAPI for my usecase doesn't offer anything new but the hype is defeaning and Typer CLI seems like a good way to build CLI projects. and Nestjs is something I should learn because I should learn. I didn't enjoy django but I need to learn a "professional" backend framework and also Typescript.
- kolanos 4y ago> I didn't enjoy django What didn't you enjoy about Django?
- anyfactor 4y agoI am not a fullstack/web developer more like a general purpose developer. So my approach of building things is hacky and straight to the point. Compared to flask there was a bit too much boilerplate involved in Django to essentially build very barebones APIs. My usecase of a backend framework involves processing data on command and serving that data. I need a few API endpoints that trigger other Python files. I build internal use APIs. So flask, particularly RESTful flask is perfect for me. I am not the intended user of Django. I was part of a few Django projects and I saw people investing more in configuring the framework right than to focus on the actual functionalities of the application. Even though they were building MVP, the initial investment in foundation building with the hopes of scalability for proof of concept project just feels wrong to me.
- Qiu_Zhanxuan 4y agoFlast-Restful/Flast-Rest-X are unmaintained... the OPENAPI/Swagger implémentation is riddled with bugs I wish Flask could be a little bit more battery included on that front. Wouldn't hurt the lightedness of the project to have automatic OPENAPI documentation, none are currently viable... That's why I switched to FastApi but I miss @app_context, and Flask Security...
- bigblind 4y agoCongrats to the maintainers!
- spacemanmatt 4y agoI'm not a big Python user but Flask keeps making my radar for being a good product.
- roflyear 4y agoRead the code some time! It is a remarkably well done project.
- zargon 4y agoAfter a cursory browse of the last few months of issues, this looks legitimate and not even a case of "ornery maintainers close everything as won't fix." (Not that it isn't their right to do so, but I did wonder.)
- capableweb 4y agoYeah, 21 PRs (from 8-10 different contributors) & 32 issues closed during the last month, pretty great stats from a FOSS project that seems to mainly be maintained by just one or two developers.
- bredren 4y agoIt speaks to organization. When I see a project this well kept I'm likely to assume there's a plan and it is being efficiently executed on. When a project is a huge backlog of unattended issues and PRs, it is much more likely that progress is slow and there's duplication effort.
- tarboreus 4y agoI've used Flask for years and it's been the least troublesome / biggest thing in my stack through everything. Every time I'm like, "I Wish Flask did that," I go to the docs and find out someone already thought about it, implemented it, and documented it. Coding around Flask is so boring I get excited every time.
- cube00 4y agoI had pitchforks at the ready if I saw any appearance of stale-bot, but you're right, it's legitimate.
- Lammy 4y agoThis post inspired me to check on Bottle, and it can't say the same: https://github.com/bottlepy/bottle https://github.com/bottlepy/bottle
- deleted 4y ago[deleted]
- gkoberger 4y agoJust echoing what a lot of people here have said – I love Flask. It was the first time I ever could relax and just enjoy programming. It was beautiful, simple, easy, thoughtful. I had been programming for years, and it just felt like a breath of fresh air at the time.
- SOLAR_FIELDS 4y agoI’ve been working with it lately and I like that it (mostly) gets out of your way. There are a few ways to get yourself into a hole as a project grows with it but for the most part it’s tough to find a more concise way to have a simple and approachable REST app
- MonkeyMalarky 4y agoComing from Java, flask felt effortless. Import the package, tack on an annotation to whatever function you want and voila you have a rest api? Fantastic! Kind of helps that a lot of complexity is shoved into the application server like gunicorn though (which is equivalent to Java's Tomcat?).
- kitd 4y agoIronically, what you've written there applies to modern Java frameworks too.
- smolder 4y agoIn trivial cases you can, IME, make clean Java REST APIs with few hurdles and not much setup effort. Expand out from there to do something meaningful and you may find yourself dealing with a mess of boilerplate and complexity that exists for corner-cases no one cares about anymore, or possibly never did. I think the modern JVM is impressive, for sure, and how much they've improved the language, too, but am also consistently impressed with how much over-thought and quirkily-named Java-specific nonsense is out to waste my time whenever I work with it. That said, I should get caught up on the latest developments...
- socialist_coder 4y agoDoes the lack of async still make Flask a good choice for non-hobby web projects?
- kissgyorgy 4y agoYes. Choosing an async framework over Flask when you don't need it is a huge mistake.
- socialist_coder 4y ago"When you don't need it" If you're doing any kind of database / external network calls - won't you gain a huge amount of requests per second? I ask partly because on one of my projects, we have a fastapi app, but it's not using async, and I have been toying with the idea of converting it to async. It will take some work though because it uses libs that don't support async. I thought the advantages would be worth it because we hit postgres and/or redis on all requests.
- mattclarkdotnet 4y agoWhy not run multiple processes? This has been the way for over 20 years.
- smackeyacky 4y agoGreen Unicorn and the like do this and do it very well.
- digisign 4y agoThe usecase for async is spidering web pages or keeping a thousand chat sockets up, not for talking to a local database.
- aeyes 4y ago> If you're doing any kind of database / external network calls - won't you gain a huge amount of requests per second? Only if they can be parallelized. I'm not sure if I would choose Flask if I had such a complex application.
- mr90210 4y agoMeanwhile well-known nodejs packages are being shipped with malware by their maintainer/authors.
- hsbauauvhabzb 4y agoI think the npm ecosystem has massive systemic flaws, but comparing an entire ecosystem to one package is unfair. If express was shipped with malware, maybe that would be more comparable.
- mr90210 4y agoSearch for node-ipc and colors (packages)
- hsbauauvhabzb 4y agoI think we’ve established that there is malware in npm?
- dmw_ng 4y agoFully developed Flask projects tend to be significantly more hairballish and custom compared to something like Django, but it's extremely hard to kick the habit and convenience once something has initially been prototyped in Flask (or Bottle, same deal). Commercially I'd much rather encounter an existing Django project, but at home 90% of the time I'll reach for Flask first, the rest being cases where there are some off-the-shelf Django components that will definitely save a ton of time, and the ceremony is worth paying.
- aenis 4y agoI am not sure if thats so hard. I had a commercial app based on Flask, about 20 endpoints and 1MB of source code, and it took me a whole 1 day to port it to FastAPI. IMHO Flask is quite elegant if used properly.
- Spivak 4y agoFlask is tight and elegant, the parents point is that unlike Django which is far more batteries included that large Flask projects end up half implementing Django but worse. And it’s no dig on Flask specifically, you can play this game with Django too, large Django projects end up half implementing ActiveJob and ActiveSupport but worse.
- jtdev 4y ago
- guggle 4y agoI've been doing similar projects (ecommerce apps) with both Django and Flask. I would choose Django over Flask anytime. MUch less fiddling.
- danjac 4y agoI've seen enough "hairball" Django projects in my time. That's not to knock either Flask or Django (or FastAPI for that matter), they all have their strengths and weaknesses, but there is little defence against a developer determined to avoid best practices and reading the documentation even for a framework as mature and well-documented as Django.
- rossdavidh 4y agoI started with, and still normally use Django if I'm doing web, but I have used Flask and quite like it. In many ways it reminds me of early Django, when it did just a few things, well. I bet it's part of how Flask's maintainer was able to get to such a "no open issues" state. We need more software like that.
- wgjordan 4y agoI've been similarly impressed by the quality of Sequel [1], a database toolkit for Ruby that accomplishes a similar feat. 0 open / 1150 closed issues, 0 open / 672 closed PRs. [1] https://github.com/jeremyevans/sequel https://github.com/jeremyevans/sequel
- hprotagonist 4y agoFlask ain’t going anywhere, but i’m a serious FastAPI devotee now. pydantic validation throwing a 422 with what’s wrong before my endpoint ever gets hit is a fucking superpower.
- kortex 4y agoI'm so spoiled by pydantic/fastapi spelling out exactly where my payload schema is wrong. I was interfacing with some google calendar API and it was constantly giving me a super vague "Bad Request" and I'm messing with the fields until finally I figure out I need a strict datetime string with four-digit timezone, no Z allowed. Like, it's delicious to be told exactly what you need to tweak to get it to accept.
- madrox 4y agoI really feel like Python has an embarrassment of riches in terms of web frameworks. Django, Flask, and even FastAPI are master classes in how to build great open source projects that will survive the test of time. In my opinion they're a huge reason why Python continues to be a popular language for backend development.
- pid-1 4y agoSomething not often mentioned: WSGI and ASGI do a great job at providing a common, well-thought abstraction to library writers.
- deaddodo 4y agoDefinitely, the biggest hiccup has been the py3 migration. But generally, once a framework is stable on a major version, it seems to have very minor necessities for upkeep (though, changes for new features definitely can improve the functionality). As to flask, I would love to see it reach the milestone that Openbox has achieved of “being done” and only really being updated for bug+security fixes or base language feature updates. As a “micro framework”, it has perfectly filled it’s necessary niche.
- JustSomeNobody 4y agoSadly, if it were “done”, a lot of devs would complain that it was dead and stop using it.
- Supermancho 4y ago> Sadly, if it were “done”, a lot of devs would complain that it was dead and stop using it Both pessimistic and incorrect. You can observe the vast number of libraries across all ecosystems that are in use, as reliable libraries, well into functional obsolescence. Not to say some niche software doesn't suffer the fate of "nothing new, so it's dead" but that's not the norm. Web frameworks are never feature-complete, per se. There are always new technologies and workflows to support. Frameworks are usually considered dead when the development halts in exhaustion or in transition to another project (as individuals, the development team members drift to these modalities), not when they are "done" by some finite collection of features.
- deleted 4y ago[deleted]
- devy 4y agoI had opened issues and MRs with projects that David Lord was a maintainer (since he's been handling lots of Pallet Team's open source projects now). Wasn't very impressive with his "my way or the high way" approach. Take a look them yourself: https://github.com/pallets/flask/issues?q=is%3Aissue+is%3Aclosed https://github.com/pallets/flask/issues?q=is%3Aissue+is%3Acl... I am quite disgusted by his self-congratulatory tweet like that, TBH. Those tickets that the community posts questions and asked for help, he just shut people down.
- bscphil 4y agoIssues are not a help forum, they are a way of reporting definite problems with a piece of software.
- CameronNemo 4y agoI thought you were just some disgruntled person. I clicked one of the recently closed issues at random. Oh boy. Closed without even a discussion about expected behavior and documentation, never followed up on. https://github.com/pallets/flask/issues/4653 https://github.com/pallets/flask/issues/4653
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- JoshCole 4y agoWent into that expecting something terrible - but he closed the issue because his implementation of JSON parsing conforms to what is actually valid JSON. Post issue closure a documentation update was suggested. It seems pretty reasonable to me for someone to close an issue asking for a deviation from valid JSON parsing behavior and it seems unreasonable to me to expect him to have been able to fortell the future, being aware of the comment that would be brought up after this closing of the issue.
- refulgentis 4y ago
- Qiu_Zhanxuan 4y agoWish Flask had a better ecosystem of extension around it So many extensions are unmaintained like flast-restful/openapi...
- nickjj 4y ago> Wish Flask had a better ecosystem of extension around it So many extensions are unmaintained like flast-restful/openapi... There's not much we can do about it I think. It's the blessing and curse of Flask. For example you can combine Flask + Flask-Classful + Flask-Marshmallow + Flask-JWT-Extended to build an API in a really really nice way IMO, but OpenAPI specs are lacking because these are 4 distinct tools that are being glued together. If generating OpenAPI specs is a top priority someone would need to bundle together the major components of an API (routing + serialization / validation + authorization) into 1 library in such a way that it's better than combining a few smaller libraries together. But if you're looking to build such a large library then it kind of goes against Flask's philosophy of being a micro-framework where you bring your own batteries. If you want full blown batteries included for an API based app then you're probably better off using Rails (even for building APIs) or Django with DRF. I'll admit it's not a great outcome tho. I really do think Flask-Classful + Flask-Marshmallow + Flask-JWT-Extended is a great combo but as someone who has been using Flask for 7+ years, have courses on Flask and have built a ton of apps with it when a client wants to build an API driven app where OpenAPI specs are important then I've gone with other solutions. Thankfully most of the apps I build return HTML and Flask is still great for building non-API based apps.
- aynyc 4y agoWell done, Flask! I always enjoy Flask. I don't like using Flask for a full-blown complex website, but for most of our API work, we use Flask and it's almost perfect fit.
- jamal-kumar 4y agoI've been using flask for 10+ years now, mostly for prototyping webapps, but it's cool to see those projects which never got too large for needing something more scalable or apt to complexity that are still up and running with minimal maintenance needed to be done on them. I think that most of the problems in flask programs I might have encountered are just problems with the language it's written in, and the tradeoffs you have to make in a dynamically typed language in terms of tooling, but those are just things you get used to as a developer wielding double edged swords all over the place. It just does an incredible job of staying out of the way and never having become some bloated beast which ends up causing problems due to some misplaced voracious appetite for eating as many batteries to include as possible.
- asdffdsa 4y agoI used Flask a long time ago, and never had any complaints. It was, and still is apparently, a great framework
- Jowsey 4y agoReally awesome feat. As a side note, not sure if it's just me, but I feel a sort of "tip jar effect" with projects that have no open PRs/issues. I feel like I'd be far less willing to submit one if there's no others there. Like all eyes would be on me if I were to do so. Something about adding your issue to the pile just feels a little more welcoming. Just me?
- djbusby 4y agoWell, you can look at history. The jar is never empty.
- b_mc2 4y agoGo to for me has been a simple Flask framework and HTMX to make my sites seem and feel more dynamic, and then deploy the whole thing with Zappa as an AWS Lambda function. Super simple to add a new endpoint in Flask and ping it with HTMX.
- nunez 4y agoif david is watching this thread: how in the HELL do you maintain Flask AND Jinja while having a life?
- digisign 4y agoI think they're just focused and mature.
- 12907835202 4y agoI've never used Flask before and come from mostly PHP/JavaScript. One of the first things that struck me reading the tutorial was the use of "g" which seems to stand for "global" and is used to access things like the DB via "g.db". This seems similar to using $GLOBALS['db'] in PHP which would be a code smell and I think it's impossible as of PHP 8.1. If I saw this in a PHP Framework I would assume it was made by an amateur. Can anyone explain if this is common practice in Python and perhaps why it's different and not a worry?
- teen 4y agousually there is a single interface to a DB. whether that's supplied via import / dep injection / global is specific to the language / framework. there are pros and cons with each.
- lionkor 4y agoIs this one of those repos that auto-close any issue, regardless of the topic, after a few weeks of inactivity? Those always have so many closed issues! Wontfix is the new completed, from what I can tell.
- haruhara 4y agoThis is the real "Dynamic Zero" policy.