Python for Decision Makers and Business Leaders Transcripts
Chapter: Web development with Python
Lecture: Python web frameworks galore
Login or purchase this course to watch this video and the rest of the course contents.
0:00 In this chapter, we're going to talk about web development with Python the whole spectrum of Python web frameworks
0:07 how to pick one, and for the first time so far in this course, we're going to write a little bit of code.
0:13 That's right, we're going to create a web application a very simple one, and we're just going to hit the highlights of creating it.
0:18 But again, it's super important to see how effective Python can be by seeing just a little bit of it in action.
0:24 So, we're going to do that in this chapter. Let's start by doing a quick purvey of the Python web frameworks. In some technologies, let's say .NET
0:33 there's almost no discussion of what web framework to use. In .NET you use ASP.NET, that's the framework from Microsoft and so you use that one.
0:43 Yeah, there's some other ones you could pick but they're not really used. ASP.NET, you don't think about it. Maybe you think about variations
0:49 but you don't actually think about the framework. In Python, it's not like that at all. There are many, many frameworks.
0:55 That's a great problem to have but it is actually a problem to decide where you should start. Just by name recognition, probably Django is the most
1:04 well-known framework. Many of the examples I showed you before on who uses Python were actually also who uses Django.
1:12 Django is great and it's been around since 2005 very popular, gotten a lot going for it. However, probably Flask is the one with the most momentum.
1:21 For example, last year, two years ago it was 15% behind in usage with Django. It made up 15% in just one year
1:29 and keep in mind, these both have been out for like 10 years so it's really starting to take off and you'll see its influence all over the place.
1:36 So these are the two big frameworks in the Python web development space. There's also Pyramid. Pyramid is a great option.
1:42 Actually our websites are built in Pyramid and it's really, really been great as well. So these are all three really good options.
1:49 Masonite is a newer one that's got a lot of helpers to help you continue to add features to your site over time. That's cool.
1:56 Starlette is one of the new foundational frameworks and I say foundational because it itself is a cool framework but there are many things
2:02 built on it as well as you'll see. So Starlette is one of the more modern frameworks. It really, for Python Three, it takes advantage
2:10 of some of the new language features about describing variable types and things like that and also supports asynchronous programming.
2:17 Built on top of Starlette is FastAPI which is a, maybe one of the best ways to build APIs these days
2:23 if it's going to be an API that gets a ton of traffic. FastAPI is on par, as fast as NodeJS, as fast as Go
2:32 and it handles the scalability that those frameworks do as well so if somebody says, we can't use Python for this 'cause it's not scalable enough
2:39 it turns out, actually, FastAPI totally does it. To be honest, many of these other frameworks also completely do it.
2:46 You know, our site, running on Pyramid gets millions of requests per month and it does terabytes of data traffic
2:52 and yet it runs just fine on this not so scalable thing right, but if you need extreme scalability FastAPI is good, Sanic is another one
3:00 that's in that extreme scalability world. It's another new framework that embraces Python's async and await.
3:06 The async programming capabilities that was recently added in Python Three and Tornado is one that's been around for quite a while
3:13 and it has, also, this asynchronous programming model but it has a older traditional model that it's kind of built-in before Python itself
3:21 had something for that. Here's a whole bunch of frameworks and, actually we're leaving many, many of them out.
3:26 These are just some of the either new and exciting ones or the most popular older ones.