RESTful and HTTP APIs in Pyramid Transcripts
Chapter: Web application building blocks
Lecture: Python web frameworks
Login or
purchase this course
to watch this video and the rest of the course contents.
0:01
Are you about ready to write some code-? I hope so, because we're about ready to pick a web framework
0:08
or at least compare them and go with Pyramid, right; go with our web framework and start creating some basic services
0:22
If you work with Python day to day, you'll know it can do amazing things, but a lot of people, they don't work with Python day to day,
0:28
and they may think well, maybe I should use some language X, technology X to build these services or web apps.
0:35
Let me show you some amazing sites which of course have many web services as part of the built with Python. So the The Onion, the very funny
0:43
sort of satired news source, that's built with Python; Spotify, their web app and some other services are built with Python.
0:51
Some of the other ones are written in Java, but Python's evolved here, Nasa, Bitly, a lot of Bitly is powered by Python,
0:58
Atlassian Bitbucket, their web app is written in Python, Survey Monkey, Quora, in my opinion, the best general Q&A site on the internet
1:09
that's written in Python, and they are very passionate users of Python, they do a lot of writing about performance and things like that,
1:15
so very interesting to look at what they're doing with Python. Disqus, these guys handle many many requests,
1:22
because they get embedded on all these different sites at the bottom so they got to handle a ton of requests and that's done significantly in Python.
1:29
Instagram, Reddit, Reddit is largely powered by Python, they use sqlalchemy core in the middle and they use Python for their web app,
1:38
YouTube is written in Python, handling several million requests per second,
1:43
we've got Pinterest, we've got PayPal, PayPal has some very powerful services that get called several billion times a day, written in Python.
1:53
Dropbox is one of the largest users of Python, they have many core developers including Guido Van Rossum, the creator of Python working there;
2:02
and of course, Talk Python, almost all of my stuff is written in Python, the web apps and the services that they need,
2:08
I'll try to point those out when it makes sense during this course. You will learn more exactly how these sites are using Python,
2:14
check out this link here at the bottom bit.ly/pyapp-25 and there is a nice article that highlights all of the usages and so on.
2:23
So when you're thinking of web frameworks, and when you're building web services, web services are really a subset of web frameworks, right
2:32
you are thinking of them there is kind of two different types of Python web frameworks, and there's a couple of other distinctions maybe we should make
2:39
but let's keep to these two for now, so on one hand we have the very small bring the building blocks that you need
2:45
in very small pieces, it's your job to find them, micro frameworks; on the other we have large what I call building block frameworks,
2:52
where most of the stuff you need is there, but you have less granularity in how you work with them, kind of take what you get there,
3:00
and the building block side of things I'd say we have Django, on the small side, we have Bottle, other frameworks down here include Flask,
3:08
and somewhere in the middle of this world, we have Pyramid. So we're going to be using Pyramid for this class,
3:14
and I think Pyramid is kind of the goldilocks framework, it's a little more full featured than Bottle of Flask,
3:18
but it's not so much so that the conventions and stuff get in the way, like Django comes with its own ORM, and yes you can use sqlalchemy with it,
3:27
but kind of have to fight the framework to do so, right. Well not with Pyramid, use whatever ORM you want,
3:33
you can use whatever formatters you want for your services, things like that. So Pyramid is really nice, especially if you are going to
3:40
also have a website component to what you're building, not every service is 100 percent standalone, maybe there's a website and some backend services
3:48
and the web site talks to the services, and maybe mobile apps talk to the talk to the services, things like that.
3:55
So understanding some of the HTML side of the framework makes some sense, because chances are you going to have some part of HTML in your service,
4:03
not everyone I know, but many of them will have a little bit of HTML as well as their service story. So Pyramid fits right in the middle here,
4:11
and I think that's a good place to work with.