r/Python • u/occams--chainsaw • Apr 26 '18
Flask 1.0 released
https://www.palletsprojects.com/blog/flask-1-0-released/22
u/ThePidesOfMarch Apr 26 '18
I don't really buy into the "framework" mindset, but I really love flask. I really just use it to handle the routes, return codes and templates (at least so far) but even just that is plenty.
14
u/strange-humor Apr 27 '18
I agree. I use Flask and like it. However, I think architecting in a Clean Architecture style and using Flask as a service to it makes more sense to me. Programmers get sucked into a framework or ORM and get locked in.
-5
u/doobiedog Apr 27 '18
Dear god yes. Orm are great for PoC but enterprise level api's become brittle when you rely on those. Need raw sql for better and more reliable performance.
4
u/strange-humor Apr 27 '18
ORMs are tunable and work for many things. I have no problem with this. Also most allow low level SQL access. What I'm talking about is basing your business objects on an ORM object.
We created DBs to deal with very slow disk access. It was a performance buffer. Now we have near infinite RAM in the form of SSDs. If the data storage is an interface to the system, this modification is simple. Otherwise, we are stuck in old models.
4
3
u/samsquamchh Apr 27 '18
Might not be the best place to ask, but I have a question regarding Flask and how up to speed it is these days. I was never particularly into web development, until I wanted to try a more easily accessible GUI for some small apps I was working on. I loved Flask from the start, but as I got myself more up to speed in the web dev world, I discovered that the "old way" of doing it is being more and more left behind by the world of single page apps and js frameworks built for that design approach.
As a result I got into vue.js and combined it with Flask, but I hit a bit of a wall there as from what I have learned so far, I can and should really use Flask just to serve json from the backend. Does that not cut off a lot of the convenient functionality and libraries of Flask that I got mildly used to before I decided to leap into the world of SPAs. Stuff like flask logins, wtforms and whatnot integrating well with jinja templates and making life easy for a python guy.
So the question is, is it actually possible to keep using the best of both worlds or is it true that Flask is not a good choice for modern web apps, at least not if you want to go the path of using some of the more modern js front end frameworks? If I'm completely wrong about this, could someone point out some resources or anything that would give me a better idea on how to integrate those two beyond the point of using flask just to serve some json from an api endpoint?
1
u/PaluMacil Apr 28 '18
I have never used Jinja templates with Flask. All my work has been either APIs consumed by other applications, Angular, or Knockout apps. Wtforms looks great, but it's just a different approach. If you've used both, you probably know the pros and cons of both approaches.
Even though it might seem like most people use some sort of SPA, that doesn't account for the huge numbers of legacy apps, Wordpress devs, and even some people are still making new Razor MVC apps in C#.
I don't think Flask is "mostly" a non-SPA app tool. Most languages people use for SPA apps are languages that also have well respected tempalting libraries as well.
2
u/samsquamchh Apr 28 '18
Hm. I quite liked the idea of continuing using Flask and python while also learning some more modern approaches with vue within the same project. I thought most of the appeal of Flask consisted of being able to essentially write your webapp in almost entirely python and being able to seamlessly use all of its capabilities and libraries for handling typical tasks like database management, user auths etc.
I was essentially hoping I can keep riding on my python skills and not have to get too serious with js, but guess I was wrong.
1
u/cleesus Jul 02 '18
Hey its beena few months and I pretty much have the same concerns you had. Did you end up sticking with Flask + Vue or did you use something else for the backend
2
u/TheAverageStream Apr 27 '18
Holy cow. I just used your web development software for my grad school project. I already loved your software, can't wait to see what's next.
2
Apr 29 '18
Really enjoy using this framework and love the support/reference material for learning it.
Flask helped me learn a lot about App architecture and programming in general (decorators are the beesknees). I wasn't aware that Flask hadn't reached 1.0 until now. I have been building with Flask since 2015.
Kudos to the Flask team and all glory to the Hypnotoad.
17
u/rJohn420 Apr 26 '18 edited Apr 27 '18
What does this exactly do? I saw that’s a web framework although I can’t really wrap my head around a python based website.
EDIT: Ok guys sorry for the dumb question but you don’t have to rape me with downvotes
12
u/Kamiwaza Apr 26 '18
Flask is a web framework like Django. Instagram uses (used?) Python/Django. https://instagram-engineering.com/web-service-efficiency-at-instagram-with-python-4976d078e366
19
u/dreadpirate15_ Apr 27 '18
They still do. Last year's Pycon keynotes included one from them talking about converting from Python 2 to 3 in the middle of the day and no one noticed.
8
u/PiousLoophole Apr 27 '18
Last year's Pycon keynotes included one from them talking about converting from Python 2 to 3 in the middle of the day and no one noticed.
Well, let's hedge that a bit. They did a structured rollout. First was IG/FB employees, then they selected 1% of the userbase, and increasing size of userbase to push to the new codebase & Python 3.
3
u/fluxdrip Apr 27 '18
Not a dumb question! I don't comment very often but you're on the python subreddit and presumably have some python experience. Flask is, actually, a terrific tool for helping you understand the power of a web framework. I strongly suggest you go through this tutorial - it'll take only a couple hours and is a lot of fun!
1
u/rJohn420 Apr 27 '18
I am currently developing a python framework for the LEGO EV3 brick. It’s helping me understand a lot about python. My objective is to learn TensorFlow.
I am currently on a trip but when I get back home I’ll surely check out that tutorial. Thanks!
0
Apr 26 '18
[deleted]
11
u/rJohn420 Apr 26 '18
Oh snap is reddit built on flask? I mean, what is the advantage of using python instead of traditional javascript?
11
Apr 27 '18
what is the advantage of using python instead of traditional javascript?
Well, besides that javascript on the backend wasn't a thing until node, some of us prefer to use as little JS as possible.
0
Apr 26 '18
[deleted]
12
u/Yoghurt42 Apr 27 '18
Reddit uses pylons, the predecessor to pyramid, which is also quite a nice framework.
0
Apr 27 '18
[deleted]
3
u/chickenpolitik Apr 27 '18
just curious, how do you know this?
0
Apr 27 '18
[deleted]
2
u/chickenpolitik Apr 27 '18
good answer! :) i'm very curious, how much can you say about it? i've never heard of flask being used for a high traffic website (like Patreon). any difficulties/particularities/idiosyncrasies at scale?
0
3
u/macromorgan Apr 27 '18
I have production websites that get hundreds of thousands of unique visitors per month and I’m not even using 1.0?
shudders
4
u/Laogeodritt Apr 27 '18
Not 1.0 doesn't mean not production ready! Some dev teams are really careful about making their project as API complete and stable as possible before announcing 1.0, especially open source non-commercial stuff where there isn't a concern about getting the project out there and bringing revenue in.
3
2
u/lolwat_is_dis Apr 27 '18
It seems people rave on about this, but as a total noob, I wish I knew how to implement this...but the tutorial is terrible. It's pretty much designed for pro's, not someone looking to get into learning Flask.
8
u/SlasherMcgurk Apr 27 '18
This gentleman, Miguel Grinberg , has a cracking flask tutorial, I am working my way through it myself.
1
u/lolwat_is_dis Apr 27 '18
Thanks, shame it's pretty expensive :( will put this one on the "to do" list, though
7
u/Dhraken Apr 27 '18
You can read the tutorial online for free on his website. But later it's worth to buy it because he did an excellent job with it.
https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world
1
1
u/bltpyro Apr 27 '18
He has it posted here for free, unless it is different. https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world
1
5
u/davidism Flask Maintainer Apr 27 '18
I'd love to see constructive feedback about the tutorial. I just rewrote the entire thing for the new release, so maybe it will be more helpful to you now. I tried to focus on helping new users organize their project and understand each function being used. It's a tricky balance between not having enough detail and having too much.
1
u/lolwat_is_dis Apr 27 '18
I totally understand. Please don't mistake my criticism as being harsh, but from an objective point of view, it's definitely not designed for someone who wants to learn how to use Python in web dev with minimal or no experience in the latter. That said, it's not really a problem, just a mild frustration that the total beginners may feel when wanting to learn about this.
1
u/raziel2p Apr 27 '18
I looked over the quickstart documentation just now and find this hard to accept. Do you have any exposure to frameworks or Python at all?
1
u/lolwat_is_dis Apr 27 '18
Python, yes.
Frameworks, no.
1
u/raziel2p Apr 27 '18
Remembering back to my first time being introduced to frameworks, and helping others through the same situation, I think it's just that the first framework you try to learn won't make that much sense in the beginning no matter what.
I'm sure there are some frameworks that do beginner-friendly stuff better than others, but mostly it'll be difficult to grasp no matter what framework you pick. I recommend finding someone to talk about it while going through the learning/documentation process, preferably in real life, but IRC channels etc. are an acceptable substitute (though you'll have to deal with elitists and people who just don't have time to give thorough help). Good luck!
1
u/amachefe Apr 28 '18
This is surprising, i started using Flask because the tutorial was the easiest to start with... Flasky
And that was before the awesome Miguel tutorial
1
0
u/Corm Apr 27 '18
This is definitely due to the Python Bytes podcast calling them out on this a couple weeks ago haha https://pythonbytes.fm/episodes/show/72/new-versioning-episode-0.0.7.2-with-72-releases
4
u/davidism Flask Maintainer Apr 27 '18
Someone else pointed out https://0ver.org on Twitter after the release, which I thought was pretty funny. I hadn't seen it before. I've been working on the 1.0 release for over a year, the 0 bugged me too. :-)
1
0
Apr 26 '18
[deleted]
37
u/YellowSharkMT Is Dave Beazley real? Apr 26 '18
Not exactly a step back. More like a spreading of wings... ? Not sure if that's a great analogy, hah. But anyhow, this might shed a bit of light, from April 1, 2016:
6 Years Ago Flask appeared. Today it finally got a Github organization. Welcome to the Pallets Project. http://palletsproject.com/blog/hello/ (https://twitter.com/mitsuhiko/status/715870150856216576)
And from https://www.palletsprojects.com/blog/hello/:
So what's changing now? Today we launch the Pallets Projects. What is it? Primarily it's a GitHub organization which will be the home of Flask and all the associated projects. It will be a new home for those libraries and the first step to give the community more impact on the development of Flask and all libraries. In addition there will be a new release of Flask very soon after a thorough check that we do not break anything.
The people behind the Pallets Projects are me, Markus Unterwaditzer, David Lord and Adrian Mönnich with the organization being open for newcomers to help and drive the projects forward.
We will spend the next few weeks adding as much organizational information on the project's website to ensure that what often currently only exists in my head is brought down to text.
I'm amazed how many people use and love Flask and my libraries and I hope that this organization will be a good step towards making this scale past me. It's humbling how big all of this became.
14
u/davidism Flask Maintainer Apr 27 '18
Armin is still involved, but the Pallets team was created so that he wouldn't have to be and the community could support it. I've been handling the 1.0 release and there have been a ton of contributions from others.
4
0
Apr 26 '18
[deleted]
6
Apr 26 '18 edited Apr 26 '18
Nah it's one person and lots of contributors for the most part, as far as I'm aware.Edit: I was wrong and I stand corrected
8
u/SnowdogU77 Apr 26 '18
The Pallets team is pleased to release Flask 1.0
...? First line in the article.
5
Apr 26 '18
Ah, sorry then. My bad.
4
u/redditor1101 Apr 27 '18
It was Armin Ronacher in the past, he transferred control to the Pallets team when he moved on to other things.
3
Apr 26 '18
I'm seeing several people in the commit log: https://github.com/pallets/flask/commits/master
4
Apr 26 '18
Yeah I updated the original comment. It seems to have changed a lot from the last time I checked.
0
Apr 26 '18
[deleted]
6
u/davidism Flask Maintainer Apr 27 '18
No one ever thinks about logging, me included. It was quite an odyssey figuring out what Flask was doing and how Python logging should actually work. The big problem was that since users don't think about logging we wanted to do it for them, but there's really no guidelines or functions to help libraries in that situation.
5
0
Apr 27 '18
[deleted]
4
u/MachaHack Apr 27 '18
Yes, unless you import them from
flask.extin which case you'll need to import them from their own package instead.Yes.
Mostly.
0
6
u/crowseldon Apr 27 '18
Not bad.
Congrats to the flask contributors! Great project!